[SERVER-13986] Creating a sparse index makes the not equals query to return diferent results. Created: 19/May/14 Updated: 11/Jul/16 Resolved: 19/May/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.4.10 |
| Fix Version/s: | 2.6.0 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | David Martin-Borregon | Assignee: | hari.khalsa@10gen.com |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Operating System: | ALL | ||||||||||||||||
| Steps To Reproduce: | in python: import pymongo ) ) ) ) |
||||||||||||||||
| Participants: | |||||||||||||||||
| Description |
|
The documentationhttp://docs.mongodb.org/manual/reference/operator/query/ne/ descrive the '$ne' function as: $ne selects the documents where the value of the field is not equal (i.e. !=) to the specified value. This includes documents that do not contain the field. However this becames is false when the queried value have an sparse index. I can workarround but is a extrange behaivour when you don't expect it. |
| Comments |
| Comment by David Storch [ 19/May/14 ] |
|
For more information, see the docs here: http://docs.mongodb.org/master/core/index-sparse/#sparse-index-incomplete-results. Or, see related tickets |
| Comment by hari.khalsa@10gen.com [ 19/May/14 ] |
|
This was fixed in 2.6 and was a known issue in 2.4.x. Negations do not use sparse indices in 2.6. |