[SERVER-12005] Improve error message for invalid hint Created: 09/Dec/13  Updated: 11/Jul/16  Resolved: 12/Dec/13

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.5.4
Fix Version/s: 2.5.5

Type: Improvement Priority: Minor - P4
Reporter: Daniel Pasette (Inactive) Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Participants:

 Description   

When hinting on a non-existent index, the new query framework error message is difficult to parse and needs at least punctuation between the message and the query details. Ideally it would tell the reason as in 2.4

In 2.4.8

> db.c.find( {} ).hint({b:1})
error: { "$err" : "bad hint", "code" : 10113 }

In 2.5.5-pre:

> db.c.find( {} ).hint({b:1})
error: {
	"$err" : "Couldn't get runner for query because: No query solutions query is ns=luke.c limit=0 skip=0\nTree: $and\nSort: {}\nProj: {}\n",
	"code" : 17007
}



 Comments   
Comment by Githook User [ 12/Dec/13 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12005 reject queries with bad hints, invalid min/max specs and missing geo indexex.
Branch: master
https://github.com/mongodb/mongo/commit/fd28dc38c37a4022082f2cb1a81a682d49fca7cb

Generated at Thu Feb 08 03:27:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.