Skip to content

neonstalwart/mongo-rql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongo-rql

Convert RQL into MongoDB queries

Build Status

Example

var mongoRql = require('mongo-rql'),
	Query = require('rql/query').Query,
	color = 'yellow',
	query = new Query().eq('color', color).sort('-size', 'price'),
	mongoQuery = mongoRql(query),
	cursor = db.collection.find(mongoQuery.criteria, {
		skip: mongoQuery.skip,
		limit: mongoQuery.limit,
		fields: mongoQuery.projection,
		sort: mongoQuery.sort
	});

	cursor.toArray(function (err, docs) {
		// ...
	});

Install

With npm do:

npm install mongo-query

License

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

© 2014 Ben Hockey

About

Convert RQL into MongoDB queries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published