Constructor and Description |
---|
GeoNearBuilder(String distanceField) |
Modifier and Type | Method and Description |
---|---|
GeoNear |
build() |
GeoNear.GeoNearBuilder |
setDistanceMultiplier(Double distanceMultiplier)
The factor to multiply all distances returned by the query.
|
GeoNear.GeoNearBuilder |
setIncludeLocations(String includeLocations)
This specifies the output field that identifies the location used to calculate the distance.
|
GeoNear.GeoNearBuilder |
setLimit(Long limit)
The maximum number of documents to return.
|
GeoNear.GeoNearBuilder |
setMaxDistance(Double maxDistance)
A distance from the center point.
|
GeoNear.GeoNearBuilder |
setMaxDocuments(Long num)
The maxDocuments option provides the same function as the limit option.
|
GeoNear.GeoNearBuilder |
setNear(double latitude,
double longitude) |
GeoNear.GeoNearBuilder |
setQuery(Query query)
Limits the results to the documents that match the query.
|
GeoNear.GeoNearBuilder |
setSpherical(Boolean spherical)
If true, MongoDB references points using a spherical surface.
|
GeoNear.GeoNearBuilder |
setUniqueDocuments(Boolean uniqueDocuments)
Deprecated.
Deprecated since server version 2.6: Geospatial queries no longer return duplicate results. The $uniqueDocs operator
has no impact on results.
|
public GeoNearBuilder(String distanceField)
distanceField
- The output field that contains the calculated distance. To specify a field within a subdocument, use dot
notation.public GeoNear.GeoNearBuilder setNear(double latitude, double longitude)
public GeoNear.GeoNearBuilder setLimit(Long limit)
setMaxDocuments(Long).
public GeoNear.GeoNearBuilder setMaxDocuments(Long num)
public GeoNear.GeoNearBuilder setMaxDistance(Double maxDistance)
public GeoNear.GeoNearBuilder setQuery(Query query)
public GeoNear.GeoNearBuilder setSpherical(Boolean spherical)
public GeoNear.GeoNearBuilder setDistanceMultiplier(Double distanceMultiplier)
public GeoNear.GeoNearBuilder setIncludeLocations(String includeLocations)
@Deprecated public GeoNear.GeoNearBuilder setUniqueDocuments(Boolean uniqueDocuments)
uniqueDocuments
- true if only unique documents are required in the return valuepublic GeoNear build()
Copyright © 2016. All rights reserved.