Package dev.morphia.aggregation.stages
Class Set
- java.lang.Object
-
- dev.morphia.aggregation.stages.Stage
-
- dev.morphia.aggregation.stages.Set
-
public class Set extends Stage
Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.The $set stage is an alias for $addFields.
Both stages are equivalent to a $project stage that explicitly specifies all existing fields in the input documents and adds the new fields.
- Since:
- 2.3
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Set()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set
field(String name, dev.morphia.aggregation.expressions.impls.Expression value)
Add a field to the stagedev.morphia.aggregation.expressions.impls.DocumentExpression
getDocument()
static Set
set()
Creates a new Set stage-
Methods inherited from class dev.morphia.aggregation.stages.Stage
aggregation, stageName
-
-
-
-
Method Detail
-
set
public static Set set()
Creates a new Set stage- Returns:
- the new stage
-
field
public Set field(String name, dev.morphia.aggregation.expressions.impls.Expression value)
Add a field to the stage- Parameters:
name
- the name of the new fieldvalue
- the value expression- Returns:
- this
-
getDocument
@MorphiaInternal public dev.morphia.aggregation.expressions.impls.DocumentExpression getDocument()
- Returns:
- the fields
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-