Why am I getting this error in a Mongolian request?

Exception Type: OperationFailure at / Exception Value: database error: point not in range 

My code is:

 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 request, I did the following:

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

My user_center and user_radius is when I printed it:

 [553068.42444848095, 4181244.9741927907] 16093.44 

All my documents in my mongo collection have UTMs very similar to user_center, so it should receive a request. But instead of returning the documents, I get this strange error.

+4
source share
1 answer

If you run Mongodb Version 1.4.0 / 1.5.0, you should upgrade to 1.5.2 if this problem is fixed.

+6
source

Source: https://habr.com/ru/post/1333920/


All Articles