Class ZipExpression
- java.lang.Object
-
- dev.morphia.aggregation.experimental.expressions.impls.Expression
-
- dev.morphia.aggregation.experimental.expressions.impls.ZipExpression
-
public class ZipExpression extends Expression
-
-
Constructor Summary
Constructors Constructor Description ZipExpression(List<Expression> inputs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ZipExpression
defaults(Expression defaults)
An array of default element values to use if the input arrays have different lengths.void
encode(Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext encoderContext)
ZipExpression
useLongestLength(Boolean useLongestLength)
Specifies whether the length of the longest array determines the number of arrays in the output array.-
Methods inherited from class dev.morphia.aggregation.experimental.expressions.impls.Expression
getOperation, getValue, toString
-
-
-
-
Constructor Detail
-
ZipExpression
public ZipExpression(List<Expression> inputs)
- Parameters:
inputs
-
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
-
Method Detail
-
defaults
public ZipExpression defaults(Expression defaults)
An array of default element values to use if the input arrays have different lengths. You must specify useLongestLength: true along with this field, or else $zip will return an error.If useLongestLength: true but defaults is empty or not specified, $zip uses null as the default value.
If specifying a non-empty defaults, you must specify a default for each input array or else $zip will return an error.
- Parameters:
defaults
- the defaults- Returns:
- this
-
encode
public void encode(Mapper mapper, org.bson.BsonWriter writer, org.bson.codecs.EncoderContext encoderContext)
- Overrides:
encode
in classExpression
- Parameters:
mapper
- the mapperwriter
- the writerencoderContext
- the context
-
useLongestLength
public ZipExpression useLongestLength(Boolean useLongestLength)
Specifies whether the length of the longest array determines the number of arrays in the output array. The default on the server is false.- Parameters:
useLongestLength
- true to use the longest length- Returns:
- this
-
-