We are using mongo (via pymongo) to store a database of points in our system. This data is returned via our api using bounding box queries ($geoWithin).
We want to limit the number of results returned to 200 sorted from the center. I'm trying to figure out the best way to do this. Currently, we get all items (no limit). Then, we calculate distance and sort in python. However, that those calculations very slow and memory intensive for large datasets.
Anyone have better suggestions? I see in other SO questions that it isn't possible to sort bounding box queries. However, most of those questions were 2+ years old.