[SERVER-8026] When an index is present, $not operator doesn't return documents that don't contain this field Created: 24/Dec/12 Updated: 15/Feb/13 Resolved: 26/Dec/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Guy Zyskind | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | // 1. Insert these 3 rows: ) ) ) // 2. Without an index, 2 results are returned as expected for 'd' // 3. Using an index, only 1 result is returned when issuing the same query. Documents without the 'date' field are ignored. ) // ( 2 == 1 ) == false |
||||||||
| Participants: | |||||||||
| Description |
|
When using the $not operator on an indexed 'date' field, only documents that contain this field are returned, while documents that do not contain this field (and should therefore be returned), are ignored. Please see steps to reproduce for details. |
| Comments |
| Comment by Aaron Staple [ 26/Dec/12 ] |
|
Hi Guy - This is a duplicate of |
| Comment by Guy Zyskind [ 24/Dec/12 ] |
|
Currently my workaround is to use $or with 1. $exists: false, 2. $gt/$lt. Unfortunately, this appears to significantly reduce performance, so a fix to this bug is still necessary. |