npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

mongoc

0.1.1

@mafintosh

npmHomeRepoSnykSocket
Downloads:134
$ npm install mongoc
DailyWeeklyMonthlyYearly

mongoc

Mongoc lets you compile mongodb queries into Javascript functions that returns true if the query fits the input

It's available through npm:

npm install mongoc

It's easy to use

var mongoc = require('mongoc');

var query = mongoc({
	hello:'world',
	time:{
		$gt:10,
		$lt:20
	}
});

console.log(query({hello:world, time:14})) // prints true;

You can use the query to filter an array

var query = mongoc({
	hello:{$in:['world','mondo']}
});

console.log([{hello:'world'},{hello:'verden'},{hello:'mondo'},{hello:'welt'}].filter(query));

For a complete reference of the query language see the mongo docs