/mongo-perstore

Primary LanguageJavaScriptOtherNOASSERTION

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