kmongo / org.litote.kmongo / kotlin.reflect.KProperty / near

near

fun <T> KProperty<T>.near(geometry: Point, maxDistance: Double? = null, minDistance: Double? = null): Bson (source)
fun <T> KProperty<T>.near(geometry: Bson, maxDistance: Double? = null, minDistance: Double? = null): Bson (source)

Creates a filter that matches all documents containing a property with geospatial data that is near the specified GeoJSON point.

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

Return
the filter

Mongodb
.driver.manual reference/operator/query/near/ $near

fun <T> KProperty<T>.near(x: Double, y: Double, maxDistance: Double? = null, minDistance: Double? = null): Bson (source)

Creates a filter that matches all documents containing a property with geospatial data that is near the specified point.

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

Return
the filter

Mongodb
.driver.manual reference/operator/query/near/ $near