diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index ffde41b..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,12 +0,0 @@ -# These are supported funding model platforms - -github: [adrai] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: # Replace with a single Patreon username -open_collective: # Replace with a single Open Collective username -ko_fi: # Replace with a single Ko-fi username -tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel -community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry -liberapay: # Replace with a single Liberapay username -issuehunt: # Replace with a single IssueHunt username -otechie: # Replace with a single Otechie username -custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 71f5e21..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -sudo: false -services: - - redis-server - - memcached - - mongodb - - couchdb - - elasticsearch - -language: node_js -node_js: - - "6" - - "8" - - "10" - - "12" - -branches: - only: - - master - -notifications: - email: - - adriano@raiano.ch diff --git a/README.md b/README.md index ac210f8..515fcf6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Introduction -[![travis](https://img.shields.io/travis/adrai/sessionstore.svg)](https://travis-ci.org/adrai/sessionstore) [![npm](https://img.shields.io/npm/v/sessionstore.svg)](https://npmjs.org/package/sessionstore) +[![npm](https://img.shields.io/npm/v/sessionstore.svg)](https://npmjs.org/package/sessionstore) Sessionstore is a node.js module for multiple databases. It can be very useful if you work with express or connect. @@ -15,9 +15,10 @@ Sessionstore is a node.js module for multiple databases. It can be very useful i var sessionstore = require('sessionstore'); var express = require('express'); + var expressSession = require('express-session'); var app = express(); - app.use(express.session({ + app.use(expressSession({ store: sessionstore.createSessionStore() })); @@ -26,9 +27,10 @@ Sessionstore is a node.js module for multiple databases. It can be very useful i var sessionstore = require('sessionstore'); var express = require('express'); + var expressSession = require('express-session'); var app = express(); - app.use(express.session({ + app.use(expressSession({ store: sessionstore.createSessionStore({ type: 'mongodb', host: 'localhost', // optional @@ -48,9 +50,10 @@ Sessionstore is a node.js module for multiple databases. It can be very useful i var sessionstore = require('sessionstore'); var express = require('express'); + var expressSession = require('express-session'); var app = express(); - app.use(express.session({ + app.use(expressSession({ store: sessionstore.createSessionStore({ type: 'tingodb', dbPath: __dirname + '/', // optional @@ -64,9 +67,10 @@ Sessionstore is a node.js module for multiple databases. It can be very useful i var sessionstore = require('sessionstore'); var express = require('express'); + var expressSession = require('express-session'); var app = express(); - app.use(express.session({ + app.use(expressSession({ store: sessionstore.createSessionStore({ type: 'couchdb', host: 'http://localhost', // optional @@ -82,9 +86,10 @@ Sessionstore is a node.js module for multiple databases. It can be very useful i var sessionstore = require('sessionstore'); var express = require('express'); + var expressSession = require('express-session'); var app = express(); - app.use(express.session({ + app.use(expressSession({ store: sessionstore.createSessionStore({ type: 'redis', host: 'localhost', // optional @@ -99,9 +104,10 @@ Sessionstore is a node.js module for multiple databases. It can be very useful i var sessionstore = require('sessionstore'); var express = require('express'); + var expressSession = require('express-session'); var app = express(); - app.use(express.session({ + app.use(expressSession({ store: sessionstore.createSessionStore({ type: 'memcached', host: 'localhost', // optional @@ -119,9 +125,10 @@ Sessionstore is a node.js module for multiple databases. It can be very useful i var sessionstore = require('sessionstore'); var express = require('express'); + var expressSession = require('express-session'); var app = express(); - app.use(express.session({ + app.use(expressSession({ store: sessionstore.createSessionStore({ type: 'elasticsearch', host: 'localhost:9200', // optional @@ -138,14 +145,14 @@ Sessionstore is a node.js module for multiple databases. It can be very useful i var ss = sessionstore.createSessionStore({ type: 'mongodb' }, function(err, ss) { console.log('hello from callback'); // use store here... - // app.use(express.session({ + // app.use(expressSession({ // store: ss // })); }); ss.on('connect', function() { console.log('hello from event'); // or here - // app.use(express.session({ + // app.use(expressSession({ // store: ss // })); }); @@ -169,7 +176,7 @@ Currently these databases are supported: # License -Copyright (c) 2019 Adriano Raiano +Copyright (c) 2020 Adriano Raiano Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/databases/mongodb.js b/lib/databases/mongodb.js index 0d8555e..b46054a 100644 --- a/lib/databases/mongodb.js +++ b/lib/databases/mongodb.js @@ -49,6 +49,7 @@ var MongoSessionStore = function (options) { if (isNew) { defaultOpt.autoReconnect = false; defaultOpt.useNewUrlParser = true; + defaultOpt.useUnifiedTopology = true; _.defaults(options.options, defaultOpt); } else { defaultOpt.auto_reconnect = false; diff --git a/licence b/licence index a35ab43..299d83a 100644 --- a/licence +++ b/licence @@ -1,4 +1,4 @@ -Copyright (c) 2019 Adriano Raiano +Copyright (c) 2020 Adriano Raiano Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/package.json b/package.json index 6602ea0..b97cdf4 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "adrai", "name": "sessionstore", - "version": "1.3.6", + "version": "1.3.8", "private": false, "main": "index.js", "engines": { @@ -13,22 +13,22 @@ "dependencies": { "async": "2.6.2", "jsondate": "0.0.1", - "lodash": "4.17.14", + "lodash": "4.17.21", "parent-require": "1.0.0", "tolerance": "1.0.0" }, "devDependencies": { - "cradle": ">=0.2.7", - "elasticsearch": ">= 10.0.0", - "eslint": ">=1.0.0", - "expect.js": ">= 0.1.2", - "express": ">= 2.5.0", - "express-session": ">= 1.0.0", - "memjs": "0.x.x", - "mocha": ">= 5.1.1", - "mongodb": "2.1.x", - "redis": ">= 0.10.1", - "tingodb": ">= 0.0.1" + "cradle": "^0.7.1", + "elasticsearch": "^10.0.0", + "eslint": "^1.0.0", + "expect.js": "^0.3.1", + "express": "^2.5.0", + "express-session": "^1.0.0", + "memjs": "^0.x.x", + "mocha": "^5.1.1", + "mongodb": "^2.1.x", + "redis": "^0.10.1", + "tingodb": "^0.6.1" }, "description": "Sessionstore is a node.js module for multiple databases. It can be very useful if you work with express or connect.", "keywords": [ diff --git a/releasenotes.md b/releasenotes.md index d0f2335..f028060 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -1,3 +1,9 @@ +### [v1.3.8](https://github.com/adrai/sessionstore/compare/v1.3.7...v1.3.8) +- update lodash dependency + +### [v1.3.7](https://github.com/adrai/sessionstore/compare/v1.3.6...v1.3.7) +- mognodb: default for useUnifiedTopology [#55](https://github.com/adrai/sessionstore/pull/55) thanks to [rohantarai](https://github.com/rohantarai) + ### [v1.3.6](https://github.com/adrai/sessionstore/compare/v1.3.5...v1.3.6) - mongodb: remove unwanted debug call