mongofilter
v2.0.0
Published
mongoquery style for standard javascript collections
Downloads
3
Readme
mongofilter
Filtering elements in collection based on json filters with a mongoQuery like syntax
Basic usage:
var filter = mongofilter({name:{$like: '%test%'}, age:12});
// filtering a complete collection
filter.filter(collection);
// or alternatively
collection.filter(filter);
// check a single item match against given filter
filter.filterItem(item); // return true or false
// also you can call 'and' or 'or' on the predicate directly:
filter.and({prop:val}).filter(collection);
filter.or({prop:val}).filter(collection);