-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 2.5.5
-
Component/s: Querying
-
None
-
ALL
-
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Specifying a hint when doing a geo $near query fails with an error:
t.find({a:4, geo: {$near: [getRandomLng(50),getRandomLat(50)]}}).hint({geo: 1}).explain().cursor
2014-02-05T15:59:44.687-0500 error: {
"$err" : "Unable to execute query: error processing query: ns=test.filters limit=0 skip=0\nTree: $and\n a == 4.0\n GEONEAR field=geo maxdist=1.79769e+308 isNearSphere=0\nSort: {}\nProj: {}\n planner returned error: bad hint",
"code" : 17007
> t.find({a:4, geo: {$near: [getRandomLng(50),getRandomLat(50)]}}).hint({a:1}).explain().cursor
2014-02-05T15:54:41.638-0500 error: {
"$err" : "Unable to execute query: error processing query: ns=test.filters limit=0 skip=0\nTree: $and\n a == 4.0 First: 0 notFirst: full path: a\n GEONEAR field=geo maxdist=1.79769e+308 isNearSphere=0 First: notFirst: full path: geo\nSort: {}\nProj: {}\n planner returned error: unable to find index for $geoNear query",
"code" : 17007
} at src/mongo/shell/query.js:131
> t.find({a:4, geo: {$near: [getRandomLng(50),getRandomLat(50)]}}).explain().cursor
GeoSearchCursor