public class CreateIndexesOperation extends java.lang.Object implements AsyncWriteOperation<java.lang.Void>, WriteOperation<java.lang.Void>
Multiple index creation is supported starting with MongoDB server version 2.6
| 构造器和说明 |
|---|
CreateIndexesOperation(MongoNamespace namespace,
java.util.List<IndexRequest> requests)
Construct a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.Void |
execute(WriteBinding binding)
General execute which can return anything of type T
|
void |
executeAsync(AsyncWriteBinding binding,
SingleResultCallback<java.lang.Void> callback)
General execute which can return anything of type T
|
java.util.List<java.lang.String> |
getIndexNames()
Gets the index names.
|
java.util.List<IndexRequest> |
getRequests()
Gets the index requests.
|
public CreateIndexesOperation(MongoNamespace namespace, java.util.List<IndexRequest> requests)
namespace - the database and collection namespace for the operation.requests - the index requestpublic java.util.List<IndexRequest> getRequests()
public java.util.List<java.lang.String> getIndexNames()
public java.lang.Void execute(WriteBinding binding)
WriteOperationexecute 在接口中 WriteOperation<java.lang.Void>binding - the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<java.lang.Void> callback)
AsyncWriteOperationexecuteAsync 在接口中 AsyncWriteOperation<java.lang.Void>binding - the binding to execute in the context ofcallback - the callback to be called when the operation has been executed