Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

35 lines (21 sloc) 0.476 kb

qmongo

Simple helper to use Q promises with Mongoose (and NodeJS). It makes very simple to chain and combine promises (especially with Q.when)

Installation

Server side

$ npm install qmongo

Usage

var qmongo = require('qmongo');
var mongoose = require('mongoose');

[...]

var newUser = new User();
Q.when(
  qmongo.exec(User.find({city: "Rome"}).limit(5)),
  qmongo.save(newUser)
).then(function(args) {
  console.log(args);
});

License

MIT

Jump to Line
Something went wrong with that request. Please try again.