Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jdesboeufs committed May 13, 2016
1 parent 008bce7 commit 26165aa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions 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
=================

Expand Down
12 changes: 10 additions & 2 deletions README.md
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 26165aa

Please sign in to comment.