https://github.com/fabienjuif/quick-mongodb-node
Simplify mongo usage a little, not big deal.
https://github.com/fabienjuif/quick-mongodb-node
layer mongo mongodb node simplify
Last synced: about 1 month ago
JSON representation
Simplify mongo usage a little, not big deal.
- Host: GitHub
- URL: https://github.com/fabienjuif/quick-mongodb-node
- Owner: fabienjuif
- License: mit
- Created: 2019-06-26T07:54:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T01:08:00.000Z (about 3 years ago)
- Last Synced: 2025-11-30T03:38:16.924Z (4 months ago)
- Topics: layer, mongo, mongodb, node, simplify
- Language: JavaScript
- Homepage:
- Size: 924 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# quick-mongodb-node
> Simplify mongo usage a little, not big deal.
   
😈 **A static variable is used in this package**
🌏 Note that this package use `MONGO_URL` as an environment variable.
### API and example
```js
const database = require('quick-mongodb-node')
// - connect to the database
// - switch do `my-db` db
// - retrieve the mongodb `my-collection` collection
let collection = await database.getCollection('my-db/my-collection')
// - will NOT connect to the database (already done the line before)
// - switch do `my-db2` db
// - retrieve the mongodb `my-collection2` collection
let collection2 = await database.getCollection('my-db2/my-collection2')
// close the connection
await database.close()
```