Class UpdateOpsImpl<T>

    • Constructor Summary

      Constructors 
      Constructor Description
      UpdateOpsImpl​(Datastore datastore, Class<T> type)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an UpdateOpsImpl for the type given.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      UpdateOperations<T> addToSet​(String field, Iterable<?> values)
      Deprecated, for removal: This API element is subject to removal in a future version.
      adds the values to an array field if they doesn't already exist in the array
      UpdateOperations<T> addToSet​(String field, Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      adds the value to an array field if it doesn't already exist in the array
      UpdateOperations<T> addToSet​(String field, List<?> values)
      Deprecated, for removal: This API element is subject to removal in a future version.
      adds the values to an array field if they doesn't already exist in the array
      UpdateOperations<T> dec​(String field)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Decrements the numeric field by 1
      UpdateOperations<T> dec​(String field, Number value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Decrements the numeric field by value (must be a positive Double, Float, Long, or Integer).
      UpdateOperations<T> disableValidation()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Turns off validation (for all calls made after)
      UpdateOperations<T> enableValidation()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Turns on validation (for all calls made after); by default validation is on
      org.bson.Document getOps()
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      UpdateOperations<T> inc​(String field)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Increments the numeric field by 1
      UpdateOperations<T> inc​(String field, Number value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      increments the numeric field by value (negatives are allowed)
      UpdateOperations<T> max​(String field, Number value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the numeric field to value if it is greater than the current value.
      UpdateOperations<T> min​(String field, Number value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      sets the numeric field to value if it is less than the current value.
      UpdateOperations<T> push​(String field, Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds new values to an array field.
      UpdateOperations<T> push​(String field, Object value, PushOptions options)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds new values to an array field at the given position
      UpdateOperations<T> push​(String field, List<?> values)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds new values to an array field.
      UpdateOperations<T> push​(String field, List<?> values, PushOptions options)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds new values to an array field at the given position
      protected UpdateOperations<T> remove​(String fieldExpr, boolean firstNotLast)
      Deprecated, for removal: This API element is subject to removal in a future version.
       
      UpdateOperations<T> removeAll​(String field, Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      removes the value from the array field
      UpdateOperations<T> removeAll​(String field, List<?> values)
      Deprecated, for removal: This API element is subject to removal in a future version.
      removes the values from the array field
      UpdateOperations<T> removeFirst​(String field)
      Deprecated, for removal: This API element is subject to removal in a future version.
      removes the first value from the array
      UpdateOperations<T> removeLast​(String field)
      Deprecated, for removal: This API element is subject to removal in a future version.
      removes the last value from the array
      UpdateOperations<T> set​(String field, Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      sets the field value
      UpdateOperations<T> setOnInsert​(String field, Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      sets the field on insert.
      void setOps​(org.bson.Document ops)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the operations for this UpdateOpsImpl
      UpdateOperations<T> unset​(String field)
      Deprecated, for removal: This API element is subject to removal in a future version.
      removes the field
    • Constructor Detail

      • UpdateOpsImpl

        public UpdateOpsImpl​(Datastore datastore,
                             Class<T> type)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates an UpdateOpsImpl for the type given.
        Parameters:
        datastore - the datastore to use
        type - the type to update
    • Method Detail

      • addToSet

        public UpdateOperations<T> addToSet​(String field,
                                            Object value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        adds the value to an array field if it doesn't already exist in the array
        Specified by:
        addToSet in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        value - the value to add
        Returns:
        this
      • addToSet

        public UpdateOperations<T> addToSet​(String field,
                                            List<?> values)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        adds the values to an array field if they doesn't already exist in the array
        Specified by:
        addToSet in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        values - the values to add
        Returns:
        this
      • addToSet

        public UpdateOperations<T> addToSet​(String field,
                                            Iterable<?> values)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        adds the values to an array field if they doesn't already exist in the array
        Specified by:
        addToSet in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        values - the values to add
        Returns:
        this
      • dec

        public UpdateOperations<T> dec​(String field)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Decrements the numeric field by 1
        Specified by:
        dec in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        Returns:
        this
      • dec

        public UpdateOperations<T> dec​(String field,
                                       Number value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Decrements the numeric field by value (must be a positive Double, Float, Long, or Integer).
        Specified by:
        dec in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        value - the value to decrement by
        Returns:
        this
      • disableValidation

        public UpdateOperations<T> disableValidation()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Turns off validation (for all calls made after)
        Specified by:
        disableValidation in interface UpdateOperations<T>
        Returns:
        this
      • enableValidation

        public UpdateOperations<T> enableValidation()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Turns on validation (for all calls made after); by default validation is on
        Specified by:
        enableValidation in interface UpdateOperations<T>
        Returns:
        this
      • inc

        public UpdateOperations<T> inc​(String field)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Increments the numeric field by 1
        Specified by:
        inc in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        Returns:
        this
      • inc

        public UpdateOperations<T> inc​(String field,
                                       Number value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        increments the numeric field by value (negatives are allowed)
        Specified by:
        inc in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        value - the value to increment by
        Returns:
        this
      • max

        public UpdateOperations<T> max​(String field,
                                       Number value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Sets the numeric field to value if it is greater than the current value.
        Specified by:
        max in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        value - the value to use
        Returns:
        this
      • min

        public UpdateOperations<T> min​(String field,
                                       Number value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        sets the numeric field to value if it is less than the current value.
        Specified by:
        min in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        value - the value to use
        Returns:
        this
      • push

        public UpdateOperations<T> push​(String field,
                                        Object value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Adds new values to an array field.
        Specified by:
        push in interface UpdateOperations<T>
        Parameters:
        field - the field to updated
        value - the value to add
        Returns:
        this
      • push

        public UpdateOperations<T> push​(String field,
                                        Object value,
                                        PushOptions options)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Adds new values to an array field at the given position
        Specified by:
        push in interface UpdateOperations<T>
        Parameters:
        field - the field to updated
        value - the value to add
        options - the options to apply to the push
        Returns:
        this
      • push

        public UpdateOperations<T> push​(String field,
                                        List<?> values)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Adds new values to an array field.
        Specified by:
        push in interface UpdateOperations<T>
        Parameters:
        field - the field to updated
        values - the values to add
        Returns:
        this
      • push

        public UpdateOperations<T> push​(String field,
                                        List<?> values,
                                        PushOptions options)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        Adds new values to an array field at the given position
        Specified by:
        push in interface UpdateOperations<T>
        Parameters:
        field - the field to updated
        values - the values to add
        options - the options to apply to the push
        Returns:
        this
      • removeAll

        public UpdateOperations<T> removeAll​(String field,
                                             Object value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        removes the value from the array field
        Specified by:
        removeAll in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        value - the value to use
        Returns:
        this
      • removeAll

        public UpdateOperations<T> removeAll​(String field,
                                             List<?> values)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        removes the values from the array field
        Specified by:
        removeAll in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        values - the values to use
        Returns:
        this
      • removeFirst

        public UpdateOperations<T> removeFirst​(String field)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        removes the first value from the array
        Specified by:
        removeFirst in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        Returns:
        this
      • removeLast

        public UpdateOperations<T> removeLast​(String field)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        removes the last value from the array
        Specified by:
        removeLast in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        Returns:
        this
      • set

        public UpdateOperations<T> set​(String field,
                                       Object value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        sets the field value
        Specified by:
        set in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        value - the value to use
        Returns:
        this
      • setOnInsert

        public UpdateOperations<T> setOnInsert​(String field,
                                               Object value)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        sets the field on insert.
        Specified by:
        setOnInsert in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        value - the value to use
        Returns:
        this
      • unset

        public UpdateOperations<T> unset​(String field)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from interface: UpdateOperations
        removes the field
        Specified by:
        unset in interface UpdateOperations<T>
        Parameters:
        field - the field to update
        Returns:
        this
      • getOps

        public org.bson.Document getOps()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns:
        the operations listed
      • setOps

        public void setOps​(org.bson.Document ops)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Sets the operations for this UpdateOpsImpl
        Parameters:
        ops - the operations
      • remove

        protected UpdateOperations<T> remove​(String fieldExpr,
                                             boolean firstNotLast)
        Deprecated, for removal: This API element is subject to removal in a future version.