Class UpdateRequest


  • Deprecated.

    @Deprecated
    public final class UpdateRequest
    extends WriteRequest
    An update to one or more documents.
    Since:
    3.0
    • Constructor Summary

      Constructors 
      Constructor Description
      UpdateRequest​(org.bson.BsonDocument filter, org.bson.BsonValue update, WriteRequest.Type updateType)
      Deprecated. 
      Construct a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      UpdateRequest arrayFilters​(java.util.List<org.bson.BsonDocument> arrayFilters)
      Deprecated. 
      Sets the array filters option
      UpdateRequest collation​(Collation collation)
      Deprecated. 
      Sets the collation options
      java.util.List<org.bson.BsonDocument> getArrayFilters​()
      Deprecated. 
      Returns the array filters option
      Collation getCollation​()
      Deprecated. 
      Returns the collation options
      org.bson.BsonDocument getFilter​()
      Deprecated. 
      Gets the query filter for the update.
      WriteRequest.Type getType​()
      Deprecated. 
      Gets the type of the write.
      org.bson.BsonDocument getUpdate​()
      Deprecated. 
      use getUpdateValue() instead
      org.bson.BsonValue getUpdateValue​()
      Deprecated. 
      Gets the update.
      boolean isMulti​()
      Deprecated. 
      Gets whether this update will update all documents matching the filter.
      boolean isUpsert​()
      Deprecated. 
      Gets whether this update will insert a new document if no documents match the filter.
      UpdateRequest multi​(boolean isMulti)
      Deprecated. 
      Sets whether this will update all documents matching the query filter.
      UpdateRequest upsert​(boolean isUpsert)
      Deprecated. 
      Sets whether this update will insert a new document if no documents match the filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UpdateRequest

        public UpdateRequest​(org.bson.BsonDocument filter,
                             org.bson.BsonValue update,
                             WriteRequest.Type updateType)
        Deprecated. 
        Construct a new instance.
        Parameters:
        filter - the non-null query filter
        update - the non-null update operations
        updateType - the update type, which must be either UPDATE or REPLACE
    • Method Detail

      • getFilter

        public org.bson.BsonDocument getFilter​()
        Deprecated. 
        Gets the query filter for the update.
        Returns:
        the filter
      • getUpdate

        @Deprecated
        public org.bson.BsonDocument getUpdate​()
        Deprecated. use getUpdateValue() instead
        Gets the update.
        Returns:
        the update
      • getUpdateValue

        public org.bson.BsonValue getUpdateValue​()
        Deprecated. 
        Gets the update. Note: Starting with server version 4.2+, the update can be either a document or a pipeline.
        Returns:
        the update
        Since:
        3.11
      • isMulti

        public boolean isMulti​()
        Deprecated. 
        Gets whether this update will update all documents matching the filter. The default is true.
        Returns:
        whether this update will update all documents matching the filter
      • multi

        public UpdateRequest multi​(boolean isMulti)
        Deprecated. 
        Sets whether this will update all documents matching the query filter.
        Parameters:
        isMulti - whether this will update all documents matching the query filter
        Returns:
        this
      • isUpsert

        public boolean isUpsert​()
        Deprecated. 
        Gets whether this update will insert a new document if no documents match the filter. The default is false.
        Returns:
        whether this update will insert a new document if no documents match the filter
      • upsert

        public UpdateRequest upsert​(boolean isUpsert)
        Deprecated. 
        Sets whether this update will insert a new document if no documents match the filter.
        Parameters:
        isUpsert - whether this update will insert a new document if no documents match the filter
        Returns:
        this
      • getCollation

        public Collation getCollation​()
        Deprecated. 
        Returns the collation options
        Returns:
        the collation options
        Since:
        3.4
        Since server release
        3.4
      • collation

        public UpdateRequest collation​(Collation collation)
        Deprecated. 
        Sets the collation options

        A null value represents the server default.

        Parameters:
        collation - the collation options to use
        Returns:
        this
        Since:
        3.4
        Since server release
        3.4
      • arrayFilters

        public UpdateRequest arrayFilters​(java.util.List<org.bson.BsonDocument> arrayFilters)
        Deprecated. 
        Sets the array filters option
        Parameters:
        arrayFilters - the array filters, which may be null
        Returns:
        this
        Since:
        3.6
        Since server release
        3.6
      • getArrayFilters

        public java.util.List<org.bson.BsonDocument> getArrayFilters​()
        Deprecated. 
        Returns the array filters option
        Returns:
        the array filters, which may be null
        Since:
        3.6
        Since server release
        3.6