AsyncWriteOperation<BulkWriteResult>
, WriteOperation<BulkWriteResult>
public class MixedBulkWriteOperation extends Object implements AsyncWriteOperation<BulkWriteResult>, WriteOperation<BulkWriteResult>
Constructor | Description |
---|---|
MixedBulkWriteOperation(MongoNamespace namespace,
List<? extends WriteRequest> writeRequests,
boolean ordered,
WriteConcern writeConcern) |
Deprecated.
|
MixedBulkWriteOperation(MongoNamespace namespace,
List<? extends WriteRequest> writeRequests,
boolean ordered,
WriteConcern writeConcern,
boolean retryWrites) |
Construct a new instance.
|
Modifier and Type | Method | Description |
---|---|---|
MixedBulkWriteOperation |
bypassDocumentValidation(Boolean bypassDocumentValidation) |
Sets the bypass document level validation flag.
|
BulkWriteResult |
execute(WriteBinding binding) |
Executes a bulk write operation.
|
void |
executeAsync(AsyncWriteBinding binding,
SingleResultCallback<BulkWriteResult> callback) |
General execute which can return anything of type T
|
Boolean |
getBypassDocumentValidation() |
Gets the the bypass document level validation flag
|
MongoNamespace |
getNamespace() |
Gets the namespace of the collection to write to.
|
Boolean |
getRetryWrites() |
Returns true if writes should be retried if they fail due to a network error.
|
WriteConcern |
getWriteConcern() |
Gets the write concern to apply
|
List<? extends WriteRequest> |
getWriteRequests() |
Gets the list of write requests to execute.
|
boolean |
isOrdered() |
Gets whether the writes are ordered.
|
@Deprecated public MixedBulkWriteOperation(MongoNamespace namespace, List<? extends WriteRequest> writeRequests, boolean ordered, WriteConcern writeConcern)
MixedBulkWriteOperation(MongoNamespace, List, boolean, WriteConcern, boolean)
insteadnamespace
- the database and collection namespace for the operation.writeRequests
- the list of writeRequests to execute.ordered
- whether the writeRequests must be executed in order.writeConcern
- the write concern for the operation.public MixedBulkWriteOperation(MongoNamespace namespace, List<? extends WriteRequest> writeRequests, boolean ordered, WriteConcern writeConcern, boolean retryWrites)
namespace
- the database and collection namespace for the operation.writeRequests
- the list of writeRequests to execute.ordered
- whether the writeRequests must be executed in order.writeConcern
- the write concern for the operation.retryWrites
- if writes should be retried if they fail due to a network error.public MongoNamespace getNamespace()
public WriteConcern getWriteConcern()
public boolean isOrdered()
public List<? extends WriteRequest> getWriteRequests()
public Boolean getBypassDocumentValidation()
public MixedBulkWriteOperation bypassDocumentValidation(Boolean bypassDocumentValidation)
bypassDocumentValidation
- If true, allows the write to opt-out of document level validation.public Boolean getRetryWrites()
public BulkWriteResult execute(WriteBinding binding)
execute
in interface WriteOperation<BulkWriteResult>
binding
- the WriteBinding for the operationMongoBulkWriteException
- if a failure to complete the bulk write is detected based on the server responsepublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<BulkWriteResult> callback)
AsyncWriteOperation
executeAsync
in interface AsyncWriteOperation<BulkWriteResult>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed