开发者

PyMongo: group with 2d geospatial index in conditions returns an error

开发者 https://www.devze.com 2023-01-18 21:43 出处:网络
The error returned is: exception: manual matcher config not allowed Here\'s my code: cond = {\'id\': id, \'date\': {\'$gte\': start_date}, \'date\': {\'$lte\': end_date}, \'location\': {\'$within\':

The error returned is:

exception: manual matcher config not allowed

Here's my code:

cond = {'id': id, 'date': {'$gte': start_date}, 'date': {'$lte': end_date}, 'location': {'$within': {'$box': box }}}
reduce = 'function(obj, prev) { prev.count++; }'
rows = collection.group({'location': True}, cond, {'count': 0}, reduce)

When I remove location from condition then it works fine. If I change the query to find it 开发者_如何学编程works fine too so it's a problem with group.

What am I doing wrong?


MongoDB currently (version 1.6.2) doesn't support geo queries for mapreduce and group functions. See http://jira.mongodb.org/browse/SERVER-1742 for the issue ticket (and consider voting it up).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号