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
- Host: GitHub
- URL: https://github.com/doasync/mongoose-connect-db
- Owner: doasync
- License: mit
- Created: 2017-07-31T09:15:19.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-08T15:32:33.000Z (over 8 years ago)
- Last Synced: 2025-03-11T14:37:26.059Z (12 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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