-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
ALL
Has been fixed in v1 indexes. Mostly creating a ticket for this so we can track the issue if reported by users.
Here is the problem for v0 indexes:
> c.drop()
true
> c.ensureIndex(
,
{v:0})
> c.save(
)
> c.find(
) // key matching only
{ "_id" : ObjectId("4ee8f8d00cf334c01d36adc3"), "a" : [ ] }> c.find(
{a:null,b:null}) // match full doc - [] not matching null
> c.count(
) // fast count bypasses matcher
1
> c.save(
) // make the index multikey
> c.find(
) // key matching does not occur for multikey indexes, so match full doc
> c.find(
) // match full doc
> c.count(
) // fast count bypasses matcher
1
We've fixed it for v1 indexes:
> c.drop()
true
> c.ensureIndex(
)
> c.save(
)
> c.find(
)
> c.find(
)
> c.count(
)
0
> c.save(
)
> c.find(
)
> c.find(
)
> c.count(
)
0
>
- related to
-
SERVER-4491 count() on a find() returns scanned count instead of result count
- Closed