|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.data.mongodb.core.aggregation.Aggregation
public class Aggregation
An Aggregation is a representation of a list of aggregation steps to be performed by the MongoDB Aggregation
Framework.
| Field Summary | |
|---|---|
static AggregationOperationContext |
DEFAULT_CONTEXT
|
| Constructor Summary | |
|---|---|
protected |
Aggregation(AggregationOperation... aggregationOperations)
Creates a new Aggregation from the given AggregationOperations. |
| Method Summary | ||
|---|---|---|
static Fields |
bind(String name,
String target)
Creates a new Fields instance from the given field name and target reference. |
|
static Fields |
fields(String... fields)
Creates a new Fields instance for the given field names. |
|
static GroupOperation |
group(Fields fields)
Creates a new GroupOperation for the given Fields. |
|
static GroupOperation |
group(String... fields)
Creates a new GroupOperation for the given fields. |
|
static org.springframework.data.mongodb.core.aggregation.LimitOperation |
limit(long maxElements)
Creates a new LimitOperation limiting the result to the given number of elements. |
|
static MatchOperation |
match(Criteria criteria)
Creates a new MatchOperation using the given Criteria. |
|
static Aggregation |
newAggregation(AggregationOperation... operations)
Creates a new Aggregation from the given AggregationOperations. |
|
static
|
newAggregation(Class<T> type,
AggregationOperation... operations)
Creates a new TypedAggregation for the given type and AggregationOperations. |
|
static String |
previousOperation()
A pointer to the previous AggregationOperation. |
|
static ProjectionOperation |
project(Fields fields)
Creates a new ProjectionOperation includeing the given Fields. |
|
static ProjectionOperation |
project(String... fields)
Creates a new ProjectionOperation including the given fields. |
|
static SkipOperation |
skip(int elementsToSkip)
Creates a new SkipOperation skipping the given number of elements. |
|
static SortOperation |
sort(Sort.Direction direction,
String... fields)
Factory method to create a new SortOperation for the given sort Sort.Direction and fields. |
|
static SortOperation |
sort(Sort sort)
Factory method to create a new SortOperation for the given Sort. |
|
com.mongodb.DBObject |
toDbObject(String inputCollectionName,
AggregationOperationContext rootContext)
Converts this Aggregation specification to a DBObject. |
|
String |
toString()
|
|
static UnwindOperation |
unwind(String field)
Factory method to create a new UnwindOperation for the field with the given name. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final AggregationOperationContext DEFAULT_CONTEXT
| Constructor Detail |
|---|
protected Aggregation(AggregationOperation... aggregationOperations)
Aggregation from the given AggregationOperations.
aggregationOperations - must not be null or empty.| Method Detail |
|---|
public static Aggregation newAggregation(AggregationOperation... operations)
Aggregation from the given AggregationOperations.
operations - must not be null or empty.
public static <T> TypedAggregation<T> newAggregation(Class<T> type,
AggregationOperation... operations)
TypedAggregation for the given type and AggregationOperations.
type - must not be null.operations - must not be null or empty.public static String previousOperation()
AggregationOperation.
public static ProjectionOperation project(String... fields)
ProjectionOperation including the given fields.
fields - must not be null.
public static ProjectionOperation project(Fields fields)
ProjectionOperation includeing the given Fields.
fields - must not be null.
public static UnwindOperation unwind(String field)
UnwindOperation for the field with the given name.
fieldName - must not be null or empty.
public static GroupOperation group(String... fields)
GroupOperation for the given fields.
fields - must not be null.
public static GroupOperation group(Fields fields)
GroupOperation for the given Fields.
fields - must not be null.
public static SortOperation sort(Sort sort)
SortOperation for the given Sort.
sort - must not be null.
public static SortOperation sort(Sort.Direction direction,
String... fields)
SortOperation for the given sort Sort.Direction and fields.
direction - must not be null.fields - must not be null.
public static SkipOperation skip(int elementsToSkip)
SkipOperation skipping the given number of elements.
elementsToSkip - must not be less than zero.
public static org.springframework.data.mongodb.core.aggregation.LimitOperation limit(long maxElements)
LimitOperation limiting the result to the given number of elements.
maxElements - must not be less than zero.
public static MatchOperation match(Criteria criteria)
MatchOperation using the given Criteria.
criteria - must not be null.
public static Fields fields(String... fields)
Fields instance for the given field names.
fields - must not be null.
Fields.fields(String...)
public static Fields bind(String name,
String target)
Fields instance from the given field name and target reference.
name - must not be null or empty.target - must not be null or empty.
public com.mongodb.DBObject toDbObject(String inputCollectionName,
AggregationOperationContext rootContext)
Aggregation specification to a DBObject.
inputCollectionName - the name of the input collection
DBObject representing this aggregationpublic String toString()
toString in class Object
|
Spring Data MongoDB - Core | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||