nearSphere
fun <T> KProperty<T>.nearSphere(geometry: Bson, maxDistance: Double? = null, minDistance: Double? = null): Bson
fun <T> KProperty<T>.nearSphere(geometry: Point, 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 using spherical geometry.
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>.nearSphere(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 using spherical geometry.
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