@apland/mongo
v1.0.3
Published
> Provides a promise that resolves into a [MongoDB collection](https://docs.mongodb.com/manual/reference/method/js-collection/).
Downloads
4
Readme
apland/mongo
Provides a promise that resolves into a MongoDB collection.
Install
$ npm install apland/mongo
Usage
Set environment variable.
MONGODB_URI="mongodb://USERNAME:PASSWORD@HOST:OOIRT/DATABASE"
Import package and access collection.
const { collection } = require('apland/mongo')
// ...
const categories = (await collection('categories')).find(filter).sort(sortBy).toArray()