1.0.3 • Published 4 years ago
@apland/mongo v1.0.3
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()