Package com.mongodb

Class BulkUpdateRequestBuilder

java.lang.Object
com.mongodb.BulkUpdateRequestBuilder

public class BulkUpdateRequestBuilder extends Object
A builder for a single update request.
Since:
2.12
MongoDB documentation
/reference/command/update
  • Method Summary

    Modifier and Type
    Method
    Description
    collation(com.mongodb.client.model.Collation collation)
    Sets the collation
    List<? extends com.mongodb.DBObject>
    Gets the array filters to apply to the update operation
    com.mongodb.client.model.Collation
    Returns the collation
    void
    replaceOne(com.mongodb.DBObject document)
    Adds a request to replace one document in the collection that matches the query with which this builder was created.
    void
    update(com.mongodb.DBObject update)
    Adds a request to update all documents in the collection that match the query with which this builder was created.
    void
    updateOne(com.mongodb.DBObject update)
    Adds a request to update one document in the collection that matches the query with which this builder was created.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getCollation

      @Nullable public com.mongodb.client.model.Collation getCollation()
      Returns the collation
      Returns:
      the collation
      Since:
      3.4
      Since server release
      3.4
    • collation

      @Nullable public BulkUpdateRequestBuilder collation(com.mongodb.client.model.Collation collation)
      Sets the collation
      Parameters:
      collation - the collation
      Returns:
      this
      Since:
      3.4
      Since server release
      3.4
    • getArrayFilters

      @Nullable public List<? extends com.mongodb.DBObject> getArrayFilters()
      Gets the array filters to apply to the update operation
      Returns:
      the array filters, which may be null
      Since:
      3.6
      Since server release
      3.6
    • replaceOne

      public void replaceOne(com.mongodb.DBObject document)
      Adds a request to replace one document in the collection that matches the query with which this builder was created.
      Parameters:
      document - the replacement document, which must be structured just as a document you would insert. It can not contain any update operators.
    • update

      public void update(com.mongodb.DBObject update)
      Adds a request to update all documents in the collection that match the query with which this builder was created.
      Parameters:
      update - the update criteria
    • updateOne

      public void updateOne(com.mongodb.DBObject update)
      Adds a request to update one document in the collection that matches the query with which this builder was created.
      Parameters:
      update - the update criteria