public class AggregationPipelineImpl extends Object implements AggregationPipeline
| Constructor and Description |
|---|
AggregationPipelineImpl(DatastoreImpl datastore,
Class source) |
| 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.
|
DBObject |
toDBObject(Projection projection) |
AggregationPipeline |
unwind(String field)
Deconstructs an array field from the input documents to output a document for each element.
|
public AggregationPipelineImpl(DatastoreImpl datastore, Class source)
public DBObject toDBObject(Projection projection)
public AggregationPipeline project(Projection... projections)
AggregationPipelineproject in interface AggregationPipelinepublic AggregationPipeline group(String id, Group... groupings)
AggregationPipelinegroup in interface AggregationPipelinepublic AggregationPipeline group(List<Group> id, Group... groupings)
group in interface AggregationPipelineAggregationPipeline.group(String, Group...)public AggregationPipeline match(Query query)
AggregationPipelinematch in interface AggregationPipelinepublic AggregationPipeline sort(Sort... sorts)
AggregationPipelinesort in interface AggregationPipelinepublic AggregationPipeline limit(int count)
AggregationPipelinelimit in interface AggregationPipelinepublic AggregationPipeline skip(int count)
AggregationPipelineskip in interface AggregationPipelinepublic AggregationPipeline unwind(String field)
AggregationPipelineunwind in interface AggregationPipelinepublic AggregationPipeline geoNear(GeoNear geoNear)
AggregationPipelinegeoNear in interface AggregationPipelinepublic <U> Iterator<U> out(Class<U> target)
AggregationPipelineAggregationOptions.out in interface AggregationPipelinetarget - The class to use when iterating over the resultspublic <U> Iterator<U> out(Class<U> target, AggregationOptions options)
AggregationPipelineout in interface AggregationPipelinetarget - The class to use when iterating over the resultsoptions - The options to apply to this aggregationpublic <U> Iterator<U> out(String collectionName, Class<U> target)
AggregationPipelineAggregationOptions.out in interface AggregationPipelinecollectionName - 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 resultspublic <U> Iterator<U> out(String collectionName, Class<U> target, AggregationOptions options)
AggregationPipelineout in interface AggregationPipelinecollectionName - 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 aggregationpublic <U> Iterator<U> aggregate(Class<U> target)
AggregationPipelineAggregationOptions.aggregate in interface AggregationPipelinetarget - The class to use when iterating over the resultspublic <U> Iterator<U> aggregate(Class<U> target, AggregationOptions options)
AggregationPipelineaggregate in interface AggregationPipelinetarget - The class to use when iterating over the resultsoptions - The options to apply to this aggregationpublic <U> Iterator<U> aggregate(Class<U> target, AggregationOptions options, ReadPreference readPreference)
AggregationPipelineaggregate in interface AggregationPipelinetarget - The class to use when iterating over the resultsoptions - The options to apply to this aggregationreadPreference - The read preference to apply to this pipelinepublic <U> Iterator<U> aggregate(String collectionName, Class<U> target, AggregationOptions options, ReadPreference readPreference)
AggregationPipelineaggregate in interface AggregationPipelinecollectionName - 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