@apland/mongo

1.0.3 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @apland/mongo

Weekly Downloads

1

Version

1.0.3

License

GPL-3.0

Unpacked Size

3.17 kB

Total Files

5

Last publish

Collaborators

  • janikvonrotz