Geospatial $near within current document field value
Yes it’s possible. You just use $geoNear instead. Beware the catches and read carefully. Presuming that your intent to is to store a field such as “travelDistance” to indicate on the document that any such searches must be “within” that supplied distance from the queried point to be valid. Then we simply query and evaluate … Read more