Package dev.morphia.query.filters
Class NearFilter
- java.lang.Object
-
- dev.morphia.query.filters.Filter
-
- dev.morphia.query.filters.NearFilter
-
public class NearFilter extends Filter
Defines a filter for $near and $nearSphere queries- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyOpts(Map<?,?> opts)NearFiltercrs(CoordinateReferenceSystem crs)Sets the coordinate reference system to usevoidencode(Datastore datastore, BsonWriter writer, EncoderContext context)NearFiltermaxDistance(Double maxDistance)Sets the max distance to considerNearFilterminDistance(Double minDistance)Sets the min distance to consider-
Methods inherited from class dev.morphia.query.filters.Filter
entityType, getField, getName, getValue, getValue, isNot, isValidating, not, path, setValue, toString, writeNamedValue, writeUnnamedValue
-
-
-
-
Method Detail
-
applyOpts
@MorphiaInternal public void applyOpts(Map<?,?> opts)
- Parameters:
opts- the options to apply
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
maxDistance
public NearFilter maxDistance(Double maxDistance)
Sets the max distance to consider- Parameters:
maxDistance- the max- Returns:
- this
-
minDistance
public NearFilter minDistance(Double minDistance)
Sets the min distance to consider- Parameters:
minDistance- the min- Returns:
- this
-
crs
public NearFilter crs(CoordinateReferenceSystem crs)
Sets the coordinate reference system to use- Parameters:
crs- the crs- Returns:
- this
-
encode
@MorphiaInternal public void encode(Datastore datastore, BsonWriter writer, EncoderContext context)
-
-