1.0.3 • Published 4 years ago

@apland/mongo v1.0.3

Weekly downloads
1
License
GPL-3.0
Repository
-
Last release
4 years ago

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()