From 26165aa4dc02236b654af9ba0a5ed0320884944c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Desboeufs?= Date: Fri, 13 May 2016 22:34:43 +0200 Subject: [PATCH] Update documentation --- CHANGELOG.md | 6 ++++++ README.md | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9339362..daeb45f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +1.2.0 / In development +================= + +* Accept `dbPromise` as connection param +* _Add_ `close()` method to close current connection + 1.1.0 / 2015-12-24 ================= diff --git a/README.md b/README.md index 41d6bd6..008ba73 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ MongoDB session store for [Connect](https://github.com/senchalabs/connect) and [ * Support all Connect versions * Support [Mongoose](http://mongoosejs.com/index.html) `>= 2.6`, `3.x` and `4.x` * Support [native MongoDB driver](http://mongodb.github.io/node-mongodb-native/) `>= 1.2`, `2.0` and `2.1` -* Support Node.js `0.10`, `0.12`, `4.x`, `5.x` and all [io.js](https://iojs.org) versions +* Support Node.js `0.10`, `0.12`, `4.x`, `5.x`, `6.x` and all [io.js](https://iojs.org) versions * Support [MongoDB](https://www.mongodb.com/) up to `3.2` For older Node.js versions `0.10`, `0.12` and io.js, please read the [Node.js compatibility section](#old-nodejs-versions-compatibility) @@ -74,7 +74,7 @@ app.use(session({ })); ``` -#### Re-use a native MongoDB driver connection +#### Re-use a native MongoDB driver connection (or a promise) In this case, you just have to give your `Db` instance to `connect-mongo`. If the connection is not opened, `connect-mongo` will do it for you. @@ -90,6 +90,14 @@ app.use(session({ })); ``` +Or just give a promise... + +```js +app.use(session({ + store: new MongoStore({ dbPromise: dbInstancePromise }) +})); +``` + #### Create a new connection from a MongoDB connection string [MongoDB connection strings](http://docs.mongodb.org/manual/reference/connection-string/) are __the best way__ to configure a new connection. For advanced usage, [more options](http://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#mongoclient-connect-options) can be configured with `mongoOptions` property.