public class CreateIndexesOperation extends Object implements AsyncWriteOperation<Void>, WriteOperation<Void>
Multiple index creation is supported starting with MongoDB server version 2.6
Constructor and Description |
---|
CreateIndexesOperation(MongoNamespace namespace,
List<IndexRequest> requests)
Construct a new instance.
|
Modifier and Type | Method and Description |
---|---|
Void |
execute(WriteBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncWriteBinding binding,
SingleResultCallback<Void> callback)
General execute which can return anything of type T
|
List<IndexRequest> |
getRequests()
Gets the index requests.
|
public CreateIndexesOperation(MongoNamespace namespace, List<IndexRequest> requests)
namespace
- the database and collection namespace for the operation.requests
- the index requestpublic List<IndexRequest> getRequests()
public Void execute(WriteBinding binding)
WriteOperation
execute
in interface WriteOperation<Void>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<Void> callback)
AsyncWriteOperation
executeAsync
in interface AsyncWriteOperation<Void>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed