[SERVER-16945] cannot specify index when count command Created: 20/Jan/15 Updated: 24/Jan/15 Resolved: 20/Jan/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Performance |
| Affects Version/s: | 2.6.5 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Weiping Ye [X] | Assignee: | David Storch |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Participants: | |||||||||
| Description |
|
when i run: , failReason: { $nin: [ -1, 0 ] }}).hint( {userId: 1}).count() |
| Comments |
| Comment by David Storch [ 20/Jan/15 ] | |
|
Thanks for the bug report. This appears to be a duplicate of
In particular, note the syntax .hint("userId_1"). (You may have to replace "userId_1" with whatever the name of your index is.) Let me know if you have any questions. Best, | |
| Comment by Weiping Ye [X] [ 20/Jan/15 ] | |
|
when i run: , failReason: { $nin: [ -1, 0 ] }}).hint( {userId: 1}).count() i got: , failReason: { $nin: [ -1.0, 0.0 ] }}, hint: { userId: 1.0 }, fields: {} } planSummary: IXSCAN { releaseTime: -1.0 }keyUpdates:0 numYields:0 locks(micros) r:374995 reslen:48 374ms it seems use wrong index 'releaseTime' instead of 'userId' |