Package com.mongodb
Class BulkWriteRequestBuilder
java.lang.Object
com.mongodb.BulkWriteRequestBuilder
A builder for a single write request.
- 
Method SummaryModifier and TypeMethodDescriptionarrayFilters(List<? extends DBObject> arrayFilters) Specifies that the request being built should use the given array filters for an update.Sets the collationReturns the collationvoidremove()Adds a request to remove all documents in the collection that match the query with which this builder was created.voidAdds a request to remove one document in the collection that matches the query with which this builder was created.voidreplaceOne(DBObject document) Adds a request to replace one document in the collection that matches the query with which this builder was created.voidAdds a request to update all documents in the collection that match the query with which this builder was created.voidAdds a request to update one document in the collection that matches the query with which this builder was created.upsert()Specifies that the request being built should be an upsert.
- 
Method Details- 
getCollationReturns the collation- Returns:
- the collation
- Since:
- 3.4
- Since server release
- 3.4
 
- 
collationSets the collation- Parameters:
- collation- the collation
- Returns:
- this
- Since:
- 3.4
- Since server release
- 3.4
 
- 
removepublic void remove()Adds a request to remove all documents in the collection that match the query with which this builder was created.
- 
removeOnepublic void removeOne()Adds a request to remove one document in the collection that matches the query with which this builder was created.
- 
replaceOneAdds 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.
 
- 
updateAdds a request to update all documents in the collection that match the query with which this builder was created.- Parameters:
- update- the update criteria
 
- 
updateOneAdds a request to update one document in the collection that matches the query with which this builder was created.- Parameters:
- update- the update criteria
 
- 
upsertSpecifies that the request being built should be an upsert.- Returns:
- a new builder that allows only update and replace, since upsert does not apply to remove.
- MongoDB documentation
- Upsert
 
- 
arrayFiltersSpecifies that the request being built should use the given array filters for an update. Note that this option only applies to update operations and will be ignored for replace operations- Parameters:
- arrayFilters- the array filters to apply to the update operation
- Returns:
- a new builder that allows only update and replace, since upsert does not apply to remove.
- Since:
- 3.6
- Since server release
- 3.6
 
 
-