• 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 class Expression
        Parameters:
        mapper - the mapper
        writer - the writer
        encoderContext - 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