[SERVER-5807] Query doesn't process correctly advanced queries on Multikeys index Created: 10/May/12 Updated: 09/Jul/16 Resolved: 10/May/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Laurent | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
The lookups index has been set as explained in http://www.mongodb.org/display/DOCS/Using+Multikeys+to+Simulate+a+Large+Number+of+Indexes The following query doesn't return any value } } }, { "state" : { "$in" : ["Active", "Verified"] }}]] } } While }, { "_lookups" : { "state" : "Verified" } }] } , { "state" : "Active" }]] } } works |
| Comments |
| Comment by Laurent [ 10/May/12 ] |
|
Thanks, you right it was in the doc but not very clearly define. It works now. |
| Comment by Scott Hernandez (Inactive) [ 10/May/12 ] |
|
Your first query is incorrect. It states that you are looking for an element equal to the document "{state:{ $in: ...}}" as described here: http://www.mongodb.org/display/DOCS/Indexes#Indexes-UsingDocumentsasKeys If you want the first query to work you would need to use the correct for with $in, which moves the $in query operator after the field (_lookups): { "_lookups" : {$in : [ { "state" : "Active"}, { "state" : "Verified"}] }} We'll cleanup the docs to make this a little more clear. |