mongo-perstore
v0.0.1
Published
perstore interface for mongodb using node-mongodb-native 2.x
Downloads
14
Maintainers
Readme
mongo-perstore
A perstore interface that persists data using MongoDB
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