Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
2.5.5
-
None
-
ALL
-
Description
The query planner returns an error when hinting on a field in a compound index. Note - this happens for the second index field (b), not the first field (a).
t.find({a: {$gt: 1}, b: 1}).hint({a: 1})
|
{ "_id" : ObjectId("52efc1e50dba2e4988556ff7"), "a" : 2, "b" : 1, "c" : 2 }
|
...
|
|
|
t.find({a: {$gt: 1}, b: 1}).hint({b: 1})
|
error: {
|
"$err" : "Unable to execute query: error processing query: ns=test.new limit=0 skip=0\nTree: $and\n b == 1.0\n a $gt 1.0\nSort: {}\nProj: {}\n planner returned error: bad hint",
|
"code" : 17007
|
}
|
|
|
t.find({a: 1, b: 1}).hint({b: 1})
|
error: {
|
"$err" : "Unable to execute query: error processing query: ns=test.new limit=0 skip=0\nTree: $and\n a == 1.0\n b == 1.0\nSort: {}\nProj: {}\n planner returned error: bad hint",
|
"code" : 17007
|
}
|
Attachments
Issue Links
- related to
-
SERVER-10340 Do not require hint() with the full index spec
-
- Closed
-