Attempting to index objects with null values in indexed fields is causing strange behaviour. For example:
collection = scule.factoryCollection('scule+dummy://test');
collection.ensureBTreeIndex('a,b', {order:1000});
for (var i=0; i < 100; i++) {
collection.save({a:i, b:i*2});
}
collection.save({a:null, b:100});
var o = collection.find({a:null}); // returns an empty array
The issue is two fold:
B+ Tree indices are not indexing null values in keys
The query parser and compiler is dropping query expressions with null values from the AST (and therefore the byte code program being compiled for the virtual machine)
Attempting to index objects with null values in indexed fields is causing strange behaviour. For example:
The issue is two fold: