public class CreateViewOperation extends Object implements AsyncWriteOperation<Void>, WriteOperation<Void>
| Constructor and Description | 
|---|
| CreateViewOperation(String databaseName,
                   String viewName,
                   String viewOn,
                   List<BsonDocument> pipeline,
                   WriteConcern writeConcern)Construct a new instance. | 
| Modifier and Type | Method and Description | 
|---|---|
| CreateViewOperation | collation(Collation collation)Sets the default collation for the view. | 
| 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 | 
| Collation | getCollation()Gets the default collation for the view | 
| String | getDatabaseName()Gets the database name | 
| List<BsonDocument> | getPipeline()Gets the pipeline that defines the view. | 
| String | getViewName()Gets the name of the view to create. | 
| String | getViewOn()Gets the name of the collection or view that backs this view. | 
| WriteConcern | getWriteConcern()Gets the write concern. | 
public CreateViewOperation(String databaseName, String viewName, String viewOn, List<BsonDocument> pipeline, WriteConcern writeConcern)
databaseName - the name of the database for the operation, which may not be nullviewName - the name of the collection to be created, which may not be nullviewOn - the name of the collection or view that backs this view, which may not be nullpipeline - the aggregation pipeline that defines the view, which may not be nullwriteConcern - the write concern, which may not be nullpublic String getDatabaseName()
public String getViewName()
public String getViewOn()
public List<BsonDocument> getPipeline()
public WriteConcern getWriteConcern()
public Collation getCollation()
public CreateViewOperation collation(Collation collation)
collation - the collation, which may be nullpublic Void execute(WriteBinding binding)
WriteOperationexecute in interface WriteOperation<Void>binding - the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<Void> callback)
AsyncWriteOperationexecuteAsync in interface AsyncWriteOperation<Void>binding - the binding to execute in the context ofcallback - the callback to be called when the operation has been executed