mongo-perstore

perstore interface for mongodb using node-mongodb-native 2.x


Keywords
persevere, perstore, mongodb
License
BSD-3-Clause
Install
npm install mongo-perstore@0.0.1

Documentation

mongo-perstore

A perstore interface that persists data using MongoDB

Build Status

Example

var MongoStore = require('mongo-perstore'),
	MongoClient = require('mongodb').MongoClient,
	url = 'mongodb://localhost:27017/mydb',
	Q = require('q'),
	db = Q.ninvoke(MongoClient, 'connect', url),
	store = new MongoStore({
		db: db,
		collection: 'myCollection'
	}),
	Query = require('rql/query').Query,
	query = new Query().eq('color', 'yellow').sort('-size', 'price');

// make a query using RQL
store.query(query).then(function (docs) {
	// ...
});

Install

With npm do:

npm install mongo-perstore

License

New BSD License. All code is developed under the terms of the Dojo Foundation CLA.

© 2014 Ben Hockey