Comment 2 for bug 1800872

Revision history for this message
John A Meinel (jameinel) wrote :

My supposition was wrong. Even in Mongo 2.4 $size: 0 only matches if you have an array:
> db.t.insert({"a": []})
> db.t.find()
{ "_id" : ObjectId("5bdea1bb8952436077782726"), "a" : [ ] }
> db.t.find({"a": {$size: 0}})
{ "_id" : ObjectId("5bdea1bb8952436077782726"), "a" : [ ] }
> db.t.find({"b": {$size: 0}})
> exit

We'll need to check how you can get into this situation. I don't know what would be deleting the arrays vs just removing items from it, and if we do need that behavior, then we should handle it in the cleanup with an $or clause.