0.0.1 • Published 12 years ago

q-mongodb v0.0.1

Weekly downloads
1
License
-
Repository
github
Last release
12 years ago

Introduction

This is a node.js module which wraps the mongodb module with the q promises module. It handles opening a db (and maintaining the open db object) as well as accessing collections (creating them if need be). If you query for the same db multiple times during the lifetime of your node app, you'll be handed the same open db object (unless you explicitly close the db with a call to closeAll()).

Usage

var QMongoDB = require('q-mongodb');

QMongoDB.db('my_db').then(function(db) {
    return QMongoDB.collection(db, 'people');
}).then(function(collection) {
    // Perform standard collection operations here
}).then(function() {
    return QMongoDB.closeAll();
});