开发者

Why am I getting this error in my Mongo query?

Exception Type: OperationFailure at /
Exception Value: database error: point开发者_如何学运维 not in range

My code is this:

user_center = [ user_utm[1], user_utm[2] ]
user_radius = tools.milesToMeters(request.session['browser_distance'])

results = db.datasets.find({"test_set":"g2", "loc_utm": {"$within": {"$center" : [ user_center, user_radius ] }}});

For my Mongo query, I did this:

db.datasets.ensureIndex({"loc_utm":"2d"}, {"min":-999999999999, "max":99999999999 } );

My user_center and user_radius is this, when I printed it out:

[553068.42444848095, 4181244.9741927907]
16093.44

All my documents in my mongo collection have a UTM very similar to the user_center, so it should get the query. But, instead of returning the documents, I get this weird error.


If you run Mongodb Version 1.4.0/1.5.0 you should upgrade to 1.5.2 where that kind of issue has been fixed.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜