-
Type:
Bug
-
Resolution: Works as Designed
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 8.0.19
-
Component/s: None
-
None
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Hi,
I'm trying to create an index to quickly check whether an array is empty or not.
I was expecting that the filter { "A.0.B":
{ $ne: null }} would do what I want and return all documents where A is an array with at least one element where B is not null, but it doesn't.
Weirdly, adding an index on that field changed the filtering behaviour to the one I was expecting but then inserting a document where A is en empty array changed the behaviour again!
I'm not sure what's the intended behaviour for
{ $ne: null }in this case, but definitely adding an index shouldn't make the behaviour change.