Package dev.morphia.aggregation.stages
Class Projection
java.lang.Object
dev.morphia.aggregation.stages.Stage
dev.morphia.aggregation.stages.Projection
Passes along the documents with the requested fields to the next stage in the pipeline. The specified fields can be existing fields
from the input documents or newly computed fields.
-
Method Summary
Modifier and TypeMethodDescriptionExcludes a field.Includes a field.Includes a field.static Projection
project()
Creates a new stageSuppresses the _id field in the resulting document.
-
Method Details
-
project
Creates a new stage- Returns:
- the new stage
- Since:
- 2.2
- MongoDB documentation
- Aggregration Pipeline Stage: $project
-
exclude
Excludes a field.- Parameters:
name
- the field name- Returns:
- this
-
include
Includes a field.- Parameters:
name
- the field namevalue
- the value expression- Returns:
- this
-
include
Includes a field.- Parameters:
name
- the field name- Returns:
- this
-
suppressId
Suppresses the _id field in the resulting document.- Returns:
- this
-