-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 2.2.0
-
Component/s: Querying
-
Environment:OSX
-
ALL
A count on a collection that exists yields an error on an invalid query. All is good.
> db.foos.insert(
{ bars: [ 1, 2 ]})
> db.foos.find({ bars : { $in : [ 1 ]}}).count()
1
> db.foos.find({ bars : { $in : null }}).count()
Mon Feb 11 16:45:53 uncaught exception: count failed:
A count on a collection that doesn't exist yields 0, which is, IMHO, incorrect.
> db.invalid.find({ bars : { $in : null }}).count()
0
This is an odd optimization, I would expect them to fail the same way.
- links to