具有地理空间条件的 Mongo 组
当我尝试将结果与地理空间条件聚合时遇到问题:
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
我对“常规”条件没有问题。
有什么想法吗?
I have an issue when I try to aggregate results with a geospatial condition :
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 } }
});
produces :
uncaught exception: group command failed: {
"errmsg" : "exception: manual matcher config not allowed",
"code" : 13285,
"ok" : 0
I have no issue with a "regular" condition.
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您在这里看到了这个错误:
http://jira.mongodb.org/browse/SERVER-1742
引用的错误使用Map-Reduce 命令,但“组”实际上只是 Map-Reduce 的准备子集。
如果您需要此功能,请对其进行投票,以便可以对其进行适当的优先级排序。
I believe that you are seeing this bug here:
http://jira.mongodb.org/browse/SERVER-1742
The bug referenced uses the Map-Reduce command, but "group" is really just a prepared subset of Map-Reduce.
If you need this functionality, please vote it up so that it can be appropriately prioritized.