public interface AggregationPipeline
| Modifier and Type | Method and Description |
|---|---|
<U> Iterator<U> |
aggregate(Class<U> target)
Executes the pipeline and aggregates the output in to the type mapped by the target type using the default options as defined in
AggregationOptions. |
<U> Iterator<U> |
aggregate(Class<U> target,
AggregationOptions options)
Executes the pipeline and aggregates the output in to the type mapped by the target type.
|
<U> Iterator<U> |
aggregate(Class<U> target,
AggregationOptions options,
ReadPreference readPreference)
Executes the pipeline and aggregates the output in to the type mapped by the target type.
|
<U> Iterator<U> |
aggregate(String collectionName,
Class<U> target,
AggregationOptions options,
ReadPreference readPreference)
Executes the pipeline and aggregates the output in to the type mapped by the target type.
|
AggregationPipeline |
geoNear(GeoNear geoNear)
Returns an ordered stream of documents based on the proximity to a geospatial point.
|
AggregationPipeline |
group(List<Group> id,
Group... groupings) |
AggregationPipeline |
group(String id,
Group... groupings)
Groups input documents by a specified identifier expression and applies the accumulator expression(s), if specified, to each group .
|
AggregationPipeline |
limit(int count)
Passes the first n documents unmodified to the pipeline where n is the specified limit.
|
AggregationPipeline |
match(Query query)
Filters the document stream to allow only matching documents to pass unmodified into the next pipeline stage.
|
<U> Iterator<U> |
out(Class<U> target)
Places the output of the aggregation in the collection mapped by the target type using the default options as defined in
AggregationOptions. |
<U> Iterator<U> |
out(Class<U> target,
AggregationOptions options)
Places the output of the aggregation in the collection mapped by the target type.
|
<U> Iterator<U> |
out(String collectionName,
Class<U> target)
Places the output of the aggregation in the collection mapped by the target type using the default options as defined in
AggregationOptions. |
<U> Iterator<U> |
out(String collectionName,
Class<U> target,
AggregationOptions options)
Places the output of the aggregation in the collection mapped by the target type.
|
AggregationPipeline |
project(Projection... projections)
Reshapes each document in the stream, such as by adding new fields or removing existing fields.
|
AggregationPipeline |
skip(int count)
Skips the first n documents where n is the specified skip number and passes the remaining documents unmodified to the pipeline.
|
AggregationPipeline |
sort(Sort... sorts)
Reorders the document stream by a specified sort key.
|
AggregationPipeline |
unwind(String field)
Deconstructs an array field from the input documents to output a document for each element.
|
AggregationPipeline project(Projection... projections)
AggregationPipeline group(String id, Group... groupings)
AggregationPipeline group(List<Group> id, Group... groupings)
group(String, Group...)AggregationPipeline match(Query query)
AggregationPipeline sort(Sort... sorts)
AggregationPipeline limit(int count)
AggregationPipeline skip(int count)
AggregationPipeline unwind(String field)
AggregationPipeline geoNear(GeoNear geoNear)
<U> Iterator<U> out(Class<U> target)
AggregationOptions.target - The class to use when iterating over the results<U> Iterator<U> out(Class<U> target, AggregationOptions options)
target - The class to use when iterating over the resultsoptions - The options to apply to this aggregation<U> Iterator<U> out(String collectionName, Class<U> target)
AggregationOptions.collectionName - The collection in which to store the results of the aggregation overriding the mapped value in targettarget - The class to use when iterating over the results<U> Iterator<U> out(String collectionName, Class<U> target, AggregationOptions options)
collectionName - The collection in which to store the results of the aggregation overriding the mapped value in targettarget - The class to use when iterating over the resultsoptions - The options to apply to this aggregation<U> Iterator<U> aggregate(Class<U> target)
AggregationOptions.target - The class to use when iterating over the results<U> Iterator<U> aggregate(Class<U> target, AggregationOptions options)
target - The class to use when iterating over the resultsoptions - The options to apply to this aggregation<U> Iterator<U> aggregate(Class<U> target, AggregationOptions options, ReadPreference readPreference)
target - The class to use when iterating over the resultsoptions - The options to apply to this aggregationreadPreference - The read preference to apply to this pipeline<U> Iterator<U> aggregate(String collectionName, Class<U> target, AggregationOptions options, ReadPreference readPreference)
collectionName - The collection in which to store the results of the aggregation overriding the mapped value in targettarget - The class to use when iterating over the resultsoptions - The options to apply to this aggregationreadPreference - The read preference to apply to this pipeline