-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.5.5
-
Component/s: Querying
-
None
-
ALL
-
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
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 }
- related to
-
SERVER-10340 Do not require hint() with the full index spec
-
- Closed
-