[SERVER-4493] v0 indexes store empty arrays as nulls and the documents containing them may be improperly returned or counted when the matcher is bypassed Created: 14/Dec/11 Updated: 03/Dec/15 Resolved: 03/Dec/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Unassigned |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
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() , {v:0}) ) ) // key matching only { "_id" : ObjectId("4ee8f8d00cf334c01d36adc3"), "a" : [ ] }> c.find( {a:null,b:null}) // match full doc - [] not matching null ) // fast count bypasses matcher ) // make the index multikey ) // key matching does not occur for multikey indexes, so match full doc ) // match full doc ) // fast count bypasses matcher We've fixed it for v1 indexes: > c.drop() ) ) ) ) ) ) ) ) ) |