Package dev.morphia.aggregation.stages
Class Unwind
- java.lang.Object
-
- dev.morphia.aggregation.stages.Stage
-
- dev.morphia.aggregation.stages.Unwind
-
public class Unwind extends Stage
Deconstructs an array field from the input documents to output a document for each element. Each output document is the input document with the value of the array field replaced by the element.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Unwind()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getIncludeArrayIndex()
dev.morphia.aggregation.expressions.impls.Expression
getPath()
Boolean
getPreserveNullAndEmptyArrays()
Unwind
includeArrayIndex(String name)
Optional.static Unwind
on(String name)
Deprecated, for removal: This API element is subject to removal in a future version.useunwind(String)
boolean
optionsPresent()
Unwind
preserveNullAndEmptyArrays(Boolean preserveNullAndEmptyArrays)
Optional.static Unwind
unwind(String name)
Creates a stage with the named array field-
Methods inherited from class dev.morphia.aggregation.stages.Stage
aggregation, stageName
-
-
-
-
Method Detail
-
on
@Deprecated(forRemoval=true) public static Unwind on(String name)
Deprecated, for removal: This API element is subject to removal in a future version.useunwind(String)
Creates a stage with the named array field- Parameters:
name
- the array field- Returns:
- this
-
unwind
public static Unwind unwind(String name)
Creates a stage with the named array field- Parameters:
name
- the array field- Returns:
- this
- Since:
- 2.2
-
getIncludeArrayIndex
@MorphiaInternal public String getIncludeArrayIndex()
- Returns:
- the value
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
getPath
@MorphiaInternal public dev.morphia.aggregation.expressions.impls.Expression getPath()
- Returns:
- the value
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
getPreserveNullAndEmptyArrays
@MorphiaInternal public Boolean getPreserveNullAndEmptyArrays()
- Returns:
- the value
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
includeArrayIndex
public Unwind includeArrayIndex(String name)
Optional. The name of a new field to hold the array index of the element. The name cannot start with a dollar sign $.- Parameters:
name
- the new name- Returns:
- this
-
optionsPresent
@MorphiaInternal public boolean optionsPresent()
- Returns:
- the value
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
preserveNullAndEmptyArrays
public Unwind preserveNullAndEmptyArrays(Boolean preserveNullAndEmptyArrays)
Optional.- If true, if the path is null, missing, or an empty array, $unwind outputs the document.
- If false, if path is null, missing, or an empty array, $unwind does not output a document.
- Parameters:
preserveNullAndEmptyArrays
- true to preserve- Returns:
- this
-
-