blow-filters
v0.1.1
Published
Builds filter function from JSON
Downloads
10
Maintainers
Readme
blow-filters
Builds filter function from JSON.
how to install
npm install --save blow-filters
how to use
import {filter} from 'blow-filters';
const data = [
{ title: 'title 1', price: 10},
{ title: 'title 2', price: 20},
{ title: 'title 3', price: 60}
];
data = data.filter(filter({price: {$lt: 60}));
console.log(data);
output:
[{title: 'title 1', price: 10}, {title: 'title 2', price: 20}]
Operators
- $eq - equal
- $neq - not equal
- $lt - less than
- $lte - less than or equal
- $gt - greater than
- $gte - greater than or equal
- $in - in array of values
- $nin - not in array of values
- $regex - regular expression
- $or - logical operator OR
You can find more details how to use each operator in tests.