This function determines if the provided `object` matches every comparison clause in `whereQuery`, returning `true` or `false` accordingly.
npm install matches-where-queryThis function determines if the provided object matches every comparison clause in whereQuery, returning true or false accordingly.
whereQuery is an object of the form:
```
{
}
, an attribute of object is compared to a value (primitive or object.) except in the cases of the isNull and isNotNull comparators, which do not require for a value to be provided.equals (default)
$3
If the attribute is a single value, object.attribute must strictly equal the value to result in a match.`
{
:
}
`$3
If the attribute is is an array, only records for which object.attribute is strictly equally to one of the elements in the array will result in a match.`
{
: [ , ..., ]
}
`contains
The compared attribute must be a string that contains the provided value, or an array that has at least one element strictly equal to the provided value.
`
{
: { comparator : 'contains', value : }
} `doesNotEqual
The compared attribute must must not be strictly equal to the value to result in a match.`
{
: { comparator : 'doesNotEqual', value : }
}
`isGreaterThan
The compared attribute must be greater than the value to result in a match. NULL values are automatically discarded.
`
{
: { comparator : 'isGreaterThan', value : }
}
`isGreaterThanOrEqualTo
The compared attribute must be greater than or equal to the value to result in a match. NULL values are automatically discarded.`
{
: { comparator : 'isGreaterThan', value : }
}
`isLessThan
The compared attribute must be less than the value to result in a match. NULL values are automatically discarded.`
{
: { comparator : 'isLessThan', value : }
}
`isLessThanOrEqualTo
The compared attribute must be less than or equal to the value to result in a match. NULL values are automatically discarded.
`
{
: { comparator : 'isLessThanOrEqualTo', value : }
}
`isBetween
The compared attribute must be between the minimum and maximum values provided to result in a match. The limits provided are included in the range for the value. NULL values are automatically discarded.`
{
: { comparator : 'isBetween', value : [ , ] }
}
`startsWith
The compared attribute must be a string that starts with the string value provided to result in a match. NULL values are automatically discarded.`
{
: { comparator : 'startsWith', value : }
}
`endsWith
The compared attribute must be a string that ends with the string value provided to result in a match. NULL values are automatically discarded.`
{
: { comparator : 'endsWith', value : }
}
`isNull
The compared attribute must be null to result in a match (no value needs to be provided).`
{
: { comparator : 'isNull' }
}
`isNotNull
The compared attribute must not be null to result in a match (no value needs to be provided).`
{
: { comparator : 'isNotNull' }
}
``