Mongodb聚合与$ geoNear异常:geoNear命令失败:{ok:0.0,errmsg:\"无法获取查询运行符\"

时间:2015-04-24 22:36:32

标签: mongodb aggregation-framework geospatial

我正在尝试使用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
 }
}

0 个答案:

没有答案
相关问题