[SERVER-14706] Queries that use negated $type predicate over a field may return incomplete results when an index is present on that field Created: 28/Jul/14 Updated: 11/Mar/15 Resolved: 31/Jul/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.6.1, 2.6.3 |
| Fix Version/s: | 2.6.5, 2.7.5 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Stennie Steneker (Inactive) | Assignee: | David Storch |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||||||||||||||
| Backport Completed: | ||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | Insert a document into a new collection, it has a single field x which is a 32-bit int:
Note that $type only matches type 16 (32-bit int), as expected:
I need to search for documents that do not match the given type, and $not works as expected:
After creating an index, $type works but $not $type does not differentiate between the 3 numeric types:
|
|||||||||||||||||||||||||||||||||||
| Participants: | ||||||||||||||||||||||||||||||||||||
| Description |
|
Issue Status as of Aug 22, 2014 ISSUE SUMMARY For example, the BSON type of an integer is 16. The following sequence displays correct behavior:
After creating an index on field "data", queries that use $type on that field work as expected, but queries that use negated $type on "data" may return an incorrect result set:
USER IMPACT WORKAROUNDS
AFFECTED VERSIONS FIX VERSION RESOLUTION DETAILS Original descriptionOriginally reported on StackOverflow.
|
| Comments |
| Comment by Githook User [ 10/Sep/14 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: (cherry picked from commit 6bfddeb720b51b88533c7ae453dc5c702fdc58a5) |
| Comment by Githook User [ 31/Jul/14 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: |