|
Currently in Bonsai if you compare if you do a find(a: {$gte: null} ) query, documents without the "a" field are incorrectly missing from the results.
Ex. find( a: {$gte: null} )
actual=[ { "_id" : 1, "a" : null } ],expected=[ { "_id" : 1, "a" : null }, { "_id" : 2, "b" : "" } ]
|
The issue lies in generateSimpleComparison. The solution likely is in the cases for Operations::Lte and Operations::Gte, where a PathDefault node must be included for the null case.
Note that this is already done for Operations:Eq in generateSimpleComparison, but must be added for Lte and Gte.
The exact same problem exists for Minkey/MaxKey. If you do find(a: {$lte: MaxKey()} ) documents without the "a" field are incorrectly missing from the results. The bugfix for minkey and maxkey should be the exact same as the null case.
Ex. find( a: {$lte: MaxKey()} )
actual=[ { "_id" : 1, "a" : null } ],expected=[ { "_id" : 1, "a" : null }, { "_id" : 2, "b" : "" } ]
|
|