Class Accumulator


  • public class Accumulator
    extends java.lang.Object
    Defines an accumulator for use in an aggregation pipeline.
    • Constructor Summary

      Constructors 
      Constructor Description
      Accumulator​(java.lang.String operation, java.lang.Object field)
      Defines an accumulator for use in an aggregation pipeline.
      Accumulator​(java.lang.String operation, java.lang.String field)
      Defines an accumulator for use in an aggregation pipeline.
    • Constructor Detail

      • Accumulator

        public Accumulator​(java.lang.String operation,
                           java.lang.String field)
        Defines an accumulator for use in an aggregation pipeline.
        Parameters:
        operation - the accumulator operation
        field - the field to use
      • Accumulator

        public Accumulator​(java.lang.String operation,
                           java.lang.Object field)
        Defines an accumulator for use in an aggregation pipeline.
        Parameters:
        operation - the accumulator operation
        field - the field to use
    • Method Detail

      • accumulator

        public static Accumulator accumulator​(java.lang.String operation,
                                              java.lang.String field)
        Defines an accumulator for use in an aggregation pipeline.
        Parameters:
        operation - the accumulator operation
        field - the field to use
        Returns:
        an Accumulator
      • accumulator

        public static Accumulator accumulator​(java.lang.String operation,
                                              java.lang.Object field)
        Defines an accumulator for use in an aggregation pipeline.
        Parameters:
        operation - the accumulator operation
        field - the field to use
        Returns:
        an Accumulator
      • getField

        @Deprecated
        public java.lang.Object getField()
        Deprecated.
        Returns:
        the value for this accumulator
      • getOperation

        public java.lang.String getOperation()
        Returns:
        the operation for this accumulator
      • getValue

        public java.lang.Object getValue()
        Returns:
        the value for this accumulator
      • toDBObject

        public com.mongodb.DBObject toDBObject()