public class UpdateOperation extends BaseWriteOperation
Constructor and Description |
---|
UpdateOperation(MongoNamespace namespace,
boolean ordered,
WriteConcern writeConcern,
List<UpdateRequest> updates)
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
protected BulkWriteResult |
executeCommandProtocol(Connection connection)
Executes the write command protocol.
|
protected void |
executeCommandProtocolAsync(AsyncConnection connection,
SingleResultCallback<BulkWriteResult> callback)
Asynchronously executes the write command protocol.
|
protected WriteConcernResult |
executeProtocol(Connection connection)
Executes the write protocol
|
protected void |
executeProtocolAsync(AsyncConnection connection,
SingleResultCallback<WriteConcernResult> callback)
Asynchronously executes the write protocol
|
protected int |
getCount(BulkWriteResult bulkWriteResult) |
protected WriteRequest.Type |
getType() |
protected boolean |
getUpdatedExisting(BulkWriteResult bulkWriteResult) |
List<UpdateRequest> |
getUpdateRequests()
Gets the list of update requests.
|
bypassDocumentValidation, execute, executeAsync, getBypassDocumentValidation, getNamespace, getWriteConcern, isOrdered
public UpdateOperation(MongoNamespace namespace, boolean ordered, WriteConcern writeConcern, List<UpdateRequest> updates)
namespace
- the database and collection namespace for the operation.ordered
- whether the updates are ordered.writeConcern
- the write concern for the operation.updates
- the update requests.public List<UpdateRequest> getUpdateRequests()
protected WriteConcernResult executeProtocol(Connection connection)
BaseWriteOperation
executeProtocol
in class BaseWriteOperation
connection
- the connectionprotected void executeProtocolAsync(AsyncConnection connection, SingleResultCallback<WriteConcernResult> callback)
BaseWriteOperation
executeProtocolAsync
in class BaseWriteOperation
connection
- the connectioncallback
- the callback to be passed the WriteConcernResultprotected BulkWriteResult executeCommandProtocol(Connection connection)
BaseWriteOperation
executeCommandProtocol
in class BaseWriteOperation
connection
- the connectionprotected void executeCommandProtocolAsync(AsyncConnection connection, SingleResultCallback<BulkWriteResult> callback)
BaseWriteOperation
executeCommandProtocolAsync
in class BaseWriteOperation
connection
- the connectioncallback
- the callback to be passed the BulkWriteResultprotected WriteRequest.Type getType()
getType
in class BaseWriteOperation
protected int getCount(BulkWriteResult bulkWriteResult)
getCount
in class BaseWriteOperation
protected boolean getUpdatedExisting(BulkWriteResult bulkWriteResult)
getUpdatedExisting
in class BaseWriteOperation