public class AggregationGeoNear extends Object implements DocumentAssignable
$geoNear
pipeline
stage of an aggregation.Modifier and Type | Class and Description |
---|---|
static class |
AggregationGeoNear.Builder
Helper for creating immutable
Find queries. |
Modifier | Constructor and Description |
---|---|
protected |
AggregationGeoNear(AggregationGeoNear.Builder builder)
Creates a new AggregationGeoNear.
|
Modifier and Type | Method and Description |
---|---|
Document |
asDocument()
Converts the object into a document.
|
static AggregationGeoNear.Builder |
builder()
Creates a new builder for an
AggregationGeoNear . |
String |
getDistanceField()
Returns the name of the field to place the distance from the source
location . |
Double |
getDistanceMultiplier()
If set returns the distance multiplier to use in the
$geoNear . |
Long |
getLimit()
If set returns the maximum number of documents to return.
|
Point2D |
getLocation()
Returns the location to find documents near.
|
String |
getLocationField()
If set returns the name of the field to place the location information
from the document.
|
Double |
getMaxDistance()
If set returns the maximum distance to return documents from the
specified location
|
Document |
getQuery()
If set returns the optional query for further refining the documents to
add to the pipeline.
|
boolean |
isSpherical()
Returns true if the
$geoNear should compute distances using
spherical coordinates instead of planar coordinates. |
boolean |
isUniqueDocs()
Returns true if the
$geoNear should only return documents once. |
protected AggregationGeoNear(AggregationGeoNear.Builder builder) throws IllegalArgumentException
builder
- he builder for the AggregationGeoNear stage.IllegalArgumentException
- If the location
or
distance field
have not been set.public static AggregationGeoNear.Builder builder()
AggregationGeoNear
.AggregationGeoNear
.public Document asDocument()
Overridden to return the $geoNear aggregation pipeline's options document. This does not include the $geoNear operator, just the options document.
asDocument
in interface DocumentAssignable
public String getDistanceField()
location
.location
.public Double getDistanceMultiplier()
$geoNear
.$geoNear
, if set.
null
otherwise.public Long getLimit()
null
otherwise.public Point2D getLocation()
public String getLocationField()
null
otherwise.public Double getMaxDistance()
null
otherwise.public Document getQuery()
null
otherwise.public boolean isSpherical()
$geoNear
should compute distances using
spherical coordinates instead of planar coordinates. Defaults to false.$geoNear
should compute distances using
spherical coordinates instead of planar coordinates.public boolean isUniqueDocs()
$geoNear
should only return documents once.
Defaults to true.$geoNear
should only return documents once.Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.