- Added stronger types for queries: crcn#197
- Fix behavior discrepancy with Mongo: crcn#196
- Fix bug where $elemMatch tested objects: e.g:
sift({a: {$elemMatch: 1}})({ a: { b: 1}})
. $elemMatch now expects arrays based on Mongodb syntax. E.g:sift({a: {$elemMatch: 1}})({ a: { b: 1}})
- new custom operations syntax (see API readme)
- null & undefined are not treated equally (change has been added to keep spec as functionality as possible to MongoDB)
select
option has been removedcompare
option now expectsboolean
return value instead of an integer- nested queries are no-longer supported
expressions
option is nowoperations
operations
parameter now expects new operations API- ImmutableJS support removed for now
- Remove bower support
- (behavior change) toJSON works for vanilla objects.
- Fix dependency vulnerability
- Fix #158
- Added
comparable
option (fix crcn#156)
- Added
compare
option (fix crcn#155)
- Query properties now excpect exact object shape (based on crcn#152). E.g:
[{a: { b: 1}}, {a: { b: 1, c: 2}}]].filter(sift({ a: { b: 1} })) === [{a: {b: 1}]
, and[{a: 1, b: 1}, {a: 1}]].filter(sift({ a: 1 })) === [{a: 1, b: 1}, {a: 1}]
.
- DEPRECATED
indexOf
in favor ofarray.findIndex(sift(query))
- second param is now
options
instead of select function. E.g:sift(query, { expressions: customExpressions, select: selectValue })
- DEPRECATED
sift(query, array)
. You must now usearray.filter(sift(query))
- Queries now expect exact object shape (based on crcn#117). E.g:
[{a: 1, b: 1}, {a: 1}]].filter(sift({ a: 1 })) === [{a: 1}]
- Remove global
*.use()
function. - converted to ES6
$in
now usestoString()
when evaluating objects. Fixes #116.
use()
now uses a different format:
sift.use({
$operator: function(a) {
return function(b) {
// compare here
};
}
});
- all operators are traversable now
- fix #58.