Class AccumulatorExpression


  • public class AccumulatorExpression
    extends Expression
    Since:
    2.1
    • Constructor Detail

      • AccumulatorExpression

        public AccumulatorExpression​(String initFunction,
                                     String accumulateFunction,
                                     List<Expression> accumulateArgs,
                                     String mergeFunction)
        Developer note.
        This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
    • Method Detail

      • 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
      • finalizeFunction

        public AccumulatorExpression finalizeFunction​(String finalizeFunction)
        Optional. Function used to update the result of the accumulation.
        Parameters:
        finalizeFunction - the function body
        Returns:
        this
      • initArgs

        public AccumulatorExpression initArgs​(List<Expression> initArgs)
        Optional. Arguments passed to the init function.
        Parameters:
        initArgs - the arguments
        Returns:
        this