then-mongo
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

then-mongo

Promise based mongo driver built on mongojs

Build Status Dependency Status NPM version

Installation

npm install then-mongo

Usage

Emulates the offical mongo api as far as is possible, except that the result of every operation is a promise, rather than being synchronous.

var mongo = require('then-mongo');
var db = mongo('connection-string', ['collectionA', 'collectionB']);
 
db.collectionA.find().skip(5).limit(10)
  .done(function (results) {
    console.dir(results);
  });

API

Exports a function connect(connectionString, collections?, options?) and returns an instance of Database. If you pass in a list of collection names, then you can access each Collection as a property of the Database instance.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i then-mongo

Weekly Downloads

90

Version

3.1.0

License

MIT

Unpacked Size

101 kB

Total Files

32

Last publish

Collaborators

  • forbeslindesay
  • then-bot