You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If this is the intended behaviour, then I'd at least like the comparePrimitives method to be explicitly exported, so that the custom compare function can just be (a, b) => a == null && b == null ? 0 : comparePrimitives(a, b)
The text was updated successfully, but these errors were encountered:
With MongoDB,
$eq: null
matches fields that are null and fields that are missing. For example, with the followingmongosh
operationon a test db with the following document,
then mongodb will return the document.
However, with UCAST (and downstream CASL), this document will not match, as
testvalue
will beundefined
.There's a few workarounds, like using
$in: [undefined, null]
or defining a customcompare
function tobuildMongoQueryMatcher
(in CASL).I have a test case prepared at forivall@1d1c5bb (branch)
If this is the intended behaviour, then I'd at least like the
comparePrimitives
method to be explicitly exported, so that the customcompare
function can just be(a, b) => a == null && b == null ? 0 : comparePrimitives(a, b)
The text was updated successfully, but these errors were encountered: