/** * Creates a filter that matches all documents containing a field with geospatial data that is near the specified point. * * @param fieldName the field name * @param x the x coordinate * @param y the y coordinate * @param maxDistance the maximum distance from the point, in radians * @param minDistance the minimum distance from the point, in radians * @return the filter * @since 3.1 * @mongodb.driver.manual reference/operator/query/near/ $near * @mongodb.server.release 2.4 */ public static Bson near(final String fieldName, final double x, final double y, final Double maxDistance, final Double minDistance) { return createNearFilterDocument(fieldName, x, y, maxDistance, minDistance, "$near"); }
/** * Creates a filter that matches all documents containing a field with geospatial data that is near the specified point using * spherical geometry. * * @param fieldName the field name * @param x the x coordinate * @param y the y coordinate * @param maxDistance the maximum distance from the point, in radians * @param minDistance the minimum distance from the point, in radians * @return the filter * @since 3.1 * @mongodb.driver.manual reference/operator/query/near/ $near * @mongodb.server.release 2.4 */ public static Bson nearSphere(final String fieldName, final double x, final double y, final Double maxDistance, final Double minDistance) { return createNearFilterDocument(fieldName, x, y, maxDistance, minDistance, "$nearSphere"); }
/** * Creates a filter that matches all documents containing a field with geospatial data that is near the specified point. * * @param fieldName the field name * @param x the x coordinate * @param y the y coordinate * @param maxDistance the maximum distance from the point, in radians * @param minDistance the minimum distance from the point, in radians * @return the filter * @since 3.1 * @mongodb.driver.manual reference/operator/query/near/ $near * @mongodb.server.release 2.4 */ public static Bson near(final String fieldName, final double x, final double y, final Double maxDistance, final Double minDistance) { return createNearFilterDocument(fieldName, x, y, maxDistance, minDistance, "$near"); }
/** * Creates a filter that matches all documents containing a field with geospatial data that is near the specified point using * spherical geometry. * * @param fieldName the field name * @param x the x coordinate * @param y the y coordinate * @param maxDistance the maximum distance from the point, in radians * @param minDistance the minimum distance from the point, in radians * @return the filter * @since 3.1 * @mongodb.driver.manual reference/operator/query/near/ $near * @mongodb.server.release 2.4 */ public static Bson nearSphere(final String fieldName, final double x, final double y, final Double maxDistance, final Double minDistance) { return createNearFilterDocument(fieldName, x, y, maxDistance, minDistance, "$nearSphere"); }