-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
Testing against 2.4.11
This works:
MyModel.where(foo_id: nil)
But this doesn't work (it only captures documents where foo_id was not nil):
MyModel.any_in(foo_id: [nil,Foo.first.id])
This also doesn't work (it captures no documents):
MyModel.any_in(foo_id: [nil])
But equivalent queries run directly against MongoDB do work:
db.my_models.find({foo_id: { $in : [null] }}) db.my_models.find({foo_id: { $in : [null,ObjectId("4fcfa5d0202cb17b63000003")] }})
The criteria_spec also doesn't handle the case where nil is passed to any_in