Skip to content

Commit

Permalink
doc(migration): update documentation about default databases
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Apr 5, 2018
1 parent e62e5c9 commit b848425
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CHANGES_3.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ MongoClient.connect('mongodb://localhost:27017/test', (err, client) => {
});
```

The database specified in the connection string will be set as the default database of the
returned client. The default database is now used if no parameter is passed to
`MongoClient.prototype.db`, for example:

```js
MongoClient.connect('mongodb://localhost:27017/test')
.then(client => client.db().collection('foo').insert({ a: 42 })
.then(() => ...)
.catc(err => ...);
```
## Other Changes
Below are more updates to the driver in the 3.0.0 release.
Expand Down

0 comments on commit b848425

Please sign in to comment.