Class NearFilter


  • public class NearFilter
    extends Filter
    Defines a filter for $near and $nearSphere queries
    Since:
    2.0
    • 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
      • encode

        @MorphiaInternal
        public void encode​(Datastore datastore,
                           BsonWriter writer,
                           EncoderContext context)
        Overrides:
        encode in class Filter
        Parameters:
        datastore - the datastore
        writer - the writer
        context - the context