An open API service indexing awesome lists of open source software.

https://github.com/doasync/mongoose-connect-db

Connect mongoose properly
https://github.com/doasync/mongoose-connect-db

Last synced: 2 months ago
JSON representation

Connect mongoose properly

Awesome Lists containing this project

README

          

# mongoose-connect-db

Mongoose's default connection logic is deprecated as of 4.11.0. Please opt in to the new connection logic.

* `useMongoClient` option
* native promise library
* write concern (journal acknowledged)
* close mongoose connection on exit

Installation
-------------

```bash
npm i --save mongoose-connect-db
```

Usage
-------------------

```javascript
const mongoose = require('mongoose');
const connectDb = require('mongoose-connect-db');

connectDb(mongoose, dbURI);
```

More
------------------
http://mongoosejs.com/docs/connections.html

http://mongoosejs.com/docs/promises.html