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.
|
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.
|
public boolean isOrdered()
DBCollection.initializeOrderedBulkOperation()
,
DBCollection.initializeUnorderedBulkOperation()
public 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
MongoException
public BulkWriteResult execute(WriteConcern writeConcern)
writeConcern
- the write concern to apply to the bulk operation.BulkWriteException
MongoException