Open j2L4e opened 6 years ago
Due to serialization the query { } is equivalent to { prop: undefined } in terms of the returned results (at least over the wire).
{ }
{ prop: undefined }
Unfortunately, siftjs handles both cases differently which can lead to an event unexpectedly not matching the initial query:
const sift = require('sift'); console.log(sift({})({ prop: 'someid' })); // true console.log(sift({ prop: undefined })({ prop: 'someid' })); // false
One q'n'd way to solve this would be stringifying and reparsing the query before passing it to sift. Maybe it's even the best way to ensure client/server consistency.
Due to serialization the query
{ }
is equivalent to{ prop: undefined }
in terms of the returned results (at least over the wire).Unfortunately, siftjs handles both cases differently which can lead to an event unexpectedly not matching the initial query:
One q'n'd way to solve this would be stringifying and reparsing the query before passing it to sift. Maybe it's even the best way to ensure client/server consistency.