near
fun <T> KProperty<T>.near(geometry: Point, maxDistance: Double? = null, minDistance: Double? = null): Bson
fun <T> KProperty<T>.near(geometry: Bson, maxDistance: Double? = null, minDistance: Double? = null): Bson
Creates a filter that matches all documents containing a property with geospatial data that is near the specified GeoJSON point.
Return
the filter
Parameters
geometry
the bounding GeoJSON geometry object
maxDistance
the maximum distance from the point, in meters
minDistance
the minimum distance from the point, in meters
fun <T> KProperty<T>.near(x: Double, y: Double, maxDistance: Double? = null, minDistance: Double? = null): Bson
Creates a filter that matches all documents containing a property with geospatial data that is near the specified point.
Return
the filter
Parameters
x
the x coordinate
y
the y coordinate
maxDistance
the maximum distance from the point, in radians
minDistance
the minimum distance from the point, in radians