Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save radinreth/61b4b824c9a1f7a32a1c5f4213939076 to your computer and use it in GitHub Desktop.
Save radinreth/61b4b824c9a1f7a32a1c5f4213939076 to your computer and use it in GitHub Desktop.
I'm using mongoose 4.11.1
and solve this problem by setting extra option `useMongoClient` to `true`
```javascript
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost:27017/database-name', { useMongoClient: true }, (err) => {
err && console.error("Error: " + error);
});
```
[For More Detail](http://mongoosejs.com/docs/connections.html#use-mongo-client)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment