Class Projection


  • @Deprecated(since="2.0",
                forRemoval=true)
    public final class Projection
    extends Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    use Projection instead
    Defines a projection for use in aggregation
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static Projection add​(Object... args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an addition projection
      static Projection divide​(Object arg1, Object arg2)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a division projection
      static Projection expression​(String operator, Object... args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Provides access to arbitrary expressions taking an array of arguments, such as $concat
      List<Object> getArguments()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      List<Projection> getProjections()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      String getSource()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      String getTarget()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      boolean isSuppressed()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      static Projection list​(Object... args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a list projection
      static Projection mod​(Object arg1, Object arg2)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a modulo projection
      static Projection multiply​(Object... args)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a multiplication projection
      static Projection projection​(String field)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a projection on a field
      static Projection projection​(String field, Projection projection, Projection... subsequent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a projection on a field with subsequent projects applied.
      static Projection projection​(String field, String projectedField)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a projection on a field and renames it
      static Projection size​(Object expression)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Counts and returns the total the number of items in an array
      static Projection subtract​(Object arg1, Object arg2)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates a subtraction projection
      Projection suppress()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Marks this field to be suppressed from the output of this stage
      String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
    • Method Detail

      • add

        public static Projection add​(Object... args)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates an addition projection
        Parameters:
        args - the projection arguments
        Returns:
        the projection
        MongoDB documentation
        Aggregration Expression: $add
      • divide

        public static Projection divide​(Object arg1,
                                        Object arg2)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a division projection
        Parameters:
        arg1 - subtraction argument
        arg2 - subtraction argument
        Returns:
        the projection
        MongoDB documentation
        Aggregration Expression: $divide
      • expression

        public static Projection expression​(String operator,
                                            Object... args)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Provides access to arbitrary expressions taking an array of arguments, such as $concat
        Parameters:
        operator - the operator for the projection
        args - the projection arguments
        Returns:
        the projection
      • list

        public static Projection list​(Object... args)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a list projection
        Parameters:
        args - the projection arguments
        Returns:
        the projection
      • mod

        public static Projection mod​(Object arg1,
                                     Object arg2)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a modulo projection
        Parameters:
        arg1 - subtraction argument
        arg2 - subtraction argument
        Returns:
        the projection
        MongoDB documentation
        Aggregration Expression: $mod
      • multiply

        public static Projection multiply​(Object... args)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a multiplication projection
        Parameters:
        args - the projection arguments
        Returns:
        the projection
        MongoDB documentation
        Aggregration Expression: $multiply
      • projection

        public static Projection projection​(String field)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a projection on a field
        Parameters:
        field - the field
        Returns:
        the projection
      • projection

        public static Projection projection​(String field,
                                            String projectedField)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a projection on a field and renames it
        Parameters:
        field - the field
        projectedField - the new field name
        Returns:
        the projection
      • projection

        public static Projection projection​(String field,
                                            Projection projection,
                                            Projection... subsequent)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a projection on a field with subsequent projects applied.
        Parameters:
        field - the field
        projection - the project to apply
        subsequent - the other projections to apply
        Returns:
        the projection
      • size

        public static Projection size​(Object expression)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Counts and returns the total the number of items in an array
        Parameters:
        expression - The argument for $size can be any expression as long as it resolves to an array.
        Returns:
        the projection
        MongoDB documentation
        Aggregration Expression: $size
      • subtract

        public static Projection subtract​(Object arg1,
                                          Object arg2)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates a subtraction projection
        Parameters:
        arg1 - subtraction argument
        arg2 - subtraction argument
        Returns:
        the projection
        MongoDB documentation
        Aggregration Expression: $subtract
      • getArguments

        @Nullable
        public List<Object> getArguments()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the arguments for the projection
      • getProjections

        @Nullable
        public List<Projection> getProjections()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        any projections applied to this field
      • getSource

        @Nullable
        public String getSource()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the projected field name
      • getTarget

        @Nullable
        public String getTarget()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the source field of the projection
      • isSuppressed

        public boolean isSuppressed()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        true if this field is suppressed from the output
      • suppress

        public Projection suppress()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Marks this field to be suppressed from the output of this stage
        Returns:
        this
      • toString

        public String toString()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Overrides:
        toString in class Object