| Modifier and Type | Method and Description |
|---|---|
static Accumulator |
addToSet(String field)
Returns an array of all unique values that results from applying an expression to each document in a group of documents that share
the same group by key.
|
static Accumulator |
average(String field)
Returns the average value of the numeric values that result from applying a specified expression to each document in a group of
documents that share the same group by key.
|
static Accumulator |
first(String field)
Returns the value that results from applying an expression to the first document in a group of documents that share the same group
by
key.
|
Accumulator |
getAccumulator() |
String |
getName() |
Group |
getNested() |
List<Projection> |
getProjections() |
String |
getSourceField() |
static Group |
grouping(String name)
Creates a named grouping
|
static Group |
grouping(String name,
Accumulator accumulator)
Creates a named grouping on a field
|
static Group |
grouping(String name,
Group group)
Creates a named grouping
|
static Group |
grouping(String name,
Projection... projections)
Creates a named grouping
|
static Group |
grouping(String name,
String sourceField)
Creates a named grouping on a field
|
static List<Group> |
id(Group... fields)
Create a group of Groups for use as an ID
|
static Accumulator |
last(String field)
Returns the value that results from applying an expression to the last document in a group of documents that share the same group by
a field.
|
static Accumulator |
max(String field)
Returns the highest value that results from applying an expression to each document in a group of documents that share the same
group
by key.
|
static Accumulator |
min(String field)
Returns the lowest value that results from applying an expression to each document in a group of documents that share the same group
by key.
|
static Accumulator |
push(String field)
Returns an array of all values that result from applying an expression to each document in a group of documents that share the same
group by key.
|
static Accumulator |
sum(String field)
Calculates and returns the sum of all the numeric values that result from applying a specified expression to each document in a
group
of documents that share the same group by key.
|
public static List<Group> id(Group... fields)
fields - the Groups to grouppublic static Group grouping(String name)
name - the field namepublic static Group grouping(String name, Projection... projections)
name - the field nameprojections - the fields to createpublic static Group grouping(String name, Group group)
name - the field namegroup - the fields to createpublic static Group grouping(String name, String sourceField)
name - the group namesourceField - the field namepublic static Group grouping(String name, Accumulator accumulator)
name - the group nameaccumulator - the Accumulator to apply to the fieldpublic static Accumulator addToSet(String field)
field - the field to processpublic static Accumulator average(String field)
field - the field to processpublic static Accumulator first(String field)
field - the field to processpublic static Accumulator last(String field)
field - the field to processpublic static Accumulator max(String field)
field - the field to processpublic static Accumulator min(String field)
field - the field to processpublic static Accumulator push(String field)
field - the field to processpublic static Accumulator sum(String field)
field - the field to processpublic Accumulator getAccumulator()
public String getName()
public String getSourceField()
public List<Projection> getProjections()
public Group getNested()