2

当我尝试使用地理空间条件聚合结果时遇到问题:

db.users.group({
    reduce: function(obj, prev) {
      prev.sums = {
        y_levels: prev.sums.y_levels + obj.current_y_level,
        x_levels: prev.sums.x_levels + obj.current_x_level,
        count: prev.sums.count + 1
      }
    },
    cond: {current_position: { $near: [56.553823, 8.565619, 10]}}, 
    initial: { sums: { y_levels: 0, x_levels: 0, count: 0 } }
});

产生:

uncaught exception: group command failed: {
        "errmsg" : "exception: manual matcher config not allowed",
        "code" : 13285,
        "ok" : 0

我对“常规”条件没有任何问题。

任何想法?

4

1 回答 1

0

我相信您在这里看到了这个错误:http: //jira.mongodb.org/browse/SERVER-1742

引用的错误使用 Map-Reduce 命令,但“组”实际上只是 Map-Reduce 的准备子集。

如果您需要此功能,请对其进行投票,以便对其进行适当的优先排序。

于 2011-03-30T21:03:11.293 回答