public class BulkWriteOperation extends Object
DBCollection.initializeOrderedBulkOperation(),
DBCollection.initializeUnorderedBulkOperation()| Modifier and Type | Method and Description |
|---|---|
BulkWriteResult |
execute()
Execute the bulk write operation with the default write concern of the collection from which this came.
|
BulkWriteResult |
execute(WriteConcern writeConcern)
Execute the bulk write operation with the given write concern.
|
BulkWriteRequestBuilder |
find(DBObject query)
Start building a write request to add to the bulk write operation.
|
Boolean |
getBypassDocumentValidation()
Gets whether to bypass document validation, or null if unspecified.
|
void |
insert(DBObject document)
Add an insert request to the bulk operation
|
boolean |
isOrdered()
Returns true if this is building an ordered bulk write request.
|
void |
setBypassDocumentValidation(Boolean bypassDocumentValidation)
Sets whether to bypass document validation.
|
public boolean isOrdered()
DBCollection.initializeOrderedBulkOperation(),
DBCollection.initializeUnorderedBulkOperation()public Boolean getBypassDocumentValidation()
public void setBypassDocumentValidation(Boolean bypassDocumentValidation)
bypassDocumentValidation - whether to bypass document validation, or null if unspecifiedpublic void insert(DBObject document)
document - the document to insertpublic BulkWriteRequestBuilder find(DBObject query)
query - the query for an update, replace or remove requestpublic BulkWriteResult execute()
BulkWriteException - if the write failed due some other failure specific to the write commandMongoException - if the operation failed for some other reasonpublic BulkWriteResult execute(WriteConcern writeConcern)
writeConcern - the write concern to apply to the bulk operation.BulkWriteException - if the write failed due some other failure specific to the write commandMongoException - if the operation failed for some other reason