Class PushOptions


  • public class PushOptions
    extends Object
    The options to apply to a $push update operator.
    Since:
    1.3
    • Constructor Detail

      • PushOptions

        public PushOptions()
        Creates an empty options class
    • Method Detail

      • position

        public PushOptions position​(int position)
        Sets the position for the update
        Parameters:
        position - the position in the array for the update
        Returns:
        this
      • slice

        public PushOptions slice​(int slice)
        Sets the slice value for the update
        Parameters:
        slice - the slice value for the update
        Returns:
        this
      • sort

        public PushOptions sort​(int sort)
        Sets the sort value for the update
        Parameters:
        sort - the sort value for the update
        Returns:
        this
      • sort

        public PushOptions sort​(String field,
                                int direction)
        Sets the sort value for the update
        Parameters:
        field - the field to sort by
        direction - the direction of the sort
        Returns:
        this
      • options

        public static PushOptions options()
        Helper method to create a PushOptions instance
        Returns:
        the new PushOptions instance