我正在尝试使用mongodb聚合运行$ geoNear并获得以下错误。我试图找到问题,但我无法做到。任何帮助,将不胜感激。
谢谢!
错误 -
var result = db.Locations
.Where(l => l.AssignedIP == workstationLocation)
.Select(l => l.<whatever string property you want>)
.FirstOrDefault();
查询 -
aggregate failed: {
"errmsg": "exception: geoNear command failed: { ok: 0.0, errmsg: \"can't get query runner\" }",
"code": 16604,
"ok": 0
} at /Users/waseemquamar/.mongorc.js:82
索引 - db.retailers.getIndexes();
db.retailers.aggregate([
{
$geoNear: {
near: { type: "Point", coordinates: [ -73.99279 , 40.719296 ] },
distanceField: "dist.calculated",
maxDistance: 2,
includeLocs: "dist.location",
num: 5,
spherical: true
}
}