Package dev.morphia.aggregation.stages
Class Group
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.Group
Groups input documents by the specified _id expression and for each distinct grouping, outputs a document.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a field to the group.Adds a named field to the group with an expression giving the value.static Group
group()
Creates a group stage with no ID definitionstatic Group
group
(Group.GroupId id) Creates a group stage with an ID definitionstatic Group.GroupId
id()
Creates an unnamed group IDstatic Group.GroupId
Creates a named group ID
-
Method Details
-
group
Creates a group stage with an ID definition- Parameters:
id
- the group ID- Returns:
- the new stage
- Since:
- 2.2
- MongoDB documentation
- Aggregration Pipeline Stage: $group
-
group
Creates a group stage with no ID definition- Returns:
- the new stage
- Since:
- 2.2
- MongoDB documentation
- Aggregration Pipeline Stage: $group
-
id
Creates an unnamed group ID- Returns:
- the new groupID
-
id
Creates a named group ID- Parameters:
name
- the id name- Returns:
- the new groupID
-
field
Adds a field to the group.- Parameters:
name
- the field name- Returns:
- this
- See Also:
-
field
Adds a named field to the group with an expression giving the value.- Parameters:
name
- the name of the fieldexpression
- the expression giving the value- Returns:
- this
-