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,
com.mongodb.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,
com.mongodb.AggregationOptions options,
com.mongodb.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,
com.mongodb.AggregationOptions options,
com.mongodb.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,
com.mongodb.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,
com.mongodb.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.
|
com.mongodb.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 com.mongodb.DBObject toDBObject(Projection projection)
public AggregationPipeline project(Projection... projections)
AggregationPipeline
project
in interface AggregationPipeline
public AggregationPipeline group(String id, Group... groupings)
AggregationPipeline
group
in interface AggregationPipeline
public AggregationPipeline group(List<Group> id, Group... groupings)
group
in interface AggregationPipeline
AggregationPipeline.group(String, Group...)
public AggregationPipeline match(Query query)
AggregationPipeline
match
in interface AggregationPipeline
public AggregationPipeline sort(Sort... sorts)
AggregationPipeline
sort
in interface AggregationPipeline
public AggregationPipeline limit(int count)
AggregationPipeline
limit
in interface AggregationPipeline
public AggregationPipeline skip(int count)
AggregationPipeline
skip
in interface AggregationPipeline
public AggregationPipeline unwind(String field)
AggregationPipeline
unwind
in interface AggregationPipeline
public AggregationPipeline geoNear(GeoNear geoNear)
AggregationPipeline
geoNear
in interface AggregationPipeline
public <U> Iterator<U> out(Class<U> target)
AggregationPipeline
AggregationOptions
.out
in interface AggregationPipeline
target
- The class to use when iterating over the resultspublic <U> Iterator<U> out(Class<U> target, com.mongodb.AggregationOptions options)
AggregationPipeline
out
in interface AggregationPipeline
target
- 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)
AggregationPipeline
AggregationOptions
.out
in interface AggregationPipeline
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 resultspublic <U> Iterator<U> out(String collectionName, Class<U> target, com.mongodb.AggregationOptions options)
AggregationPipeline
out
in interface AggregationPipeline
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 aggregationpublic <U> Iterator<U> aggregate(Class<U> target)
AggregationPipeline
AggregationOptions
.aggregate
in interface AggregationPipeline
target
- The class to use when iterating over the resultspublic <U> Iterator<U> aggregate(Class<U> target, com.mongodb.AggregationOptions options)
AggregationPipeline
aggregate
in interface AggregationPipeline
target
- The class to use when iterating over the resultsoptions
- The options to apply to this aggregationpublic <U> Iterator<U> aggregate(Class<U> target, com.mongodb.AggregationOptions options, com.mongodb.ReadPreference readPreference)
AggregationPipeline
aggregate
in interface AggregationPipeline
target
- 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, com.mongodb.AggregationOptions options, com.mongodb.ReadPreference readPreference)
AggregationPipeline
aggregate
in interface AggregationPipeline
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 pipelineCopyright © 2016. All rights reserved.