public class BulkWriteOperation
extends java.lang.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.
|
java.lang.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(java.lang.Boolean bypassDocumentValidation)
Sets whether to bypass document validation.
|
public boolean isOrdered()
DBCollection.initializeOrderedBulkOperation()
,
DBCollection.initializeUnorderedBulkOperation()
public java.lang.Boolean getBypassDocumentValidation()
public void setBypassDocumentValidation(java.lang.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