Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
README.md
index.js
index.test.js
package-lock.json
package.json
yarn.lock

README.md

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()
You can’t perform that action at this time.