Request about vs. inside

Using MongoDB I am requesting homes that are within 25 miles of lat / long.

My first attempt to do this used a close command, for example:

var near = Query.Near("Coordinates", coordinates.Latitude, coordinates.Longitude, find.GetRadiansAway(), false);
var query = Collection().Find(near);
var listings = query.ToList();

The problem with the series is that it returns only 100 lists, while I want to return all lists within a radius of 25 miles from the coordinates.

My next attempt was to use inside:

var within = Query.WithinCircle("Coordinates", coordinates.Latitude, coordinates.Longitude, find.GetRadiansAway(), false);
var query = Collection().Find(within);
var listings = query.ToList();

Inside, all lists are returned within 25 miles, which is great, but it does not sort them by how close they are to the center coordinates, for example, nearby.

So my question is: how do I get the best of both worlds? How to get all the lists within 25 miles and sort them by proximity to the center coordinates?

+5
1

$near limit() 100 . , limit().

"" , "" ( "" ).

+11

All Articles