public class CreateViewOperation extends java.lang.Object implements AsyncWriteOperation<java.lang.Void>, WriteOperation<java.lang.Void>
Constructor and Description |
---|
CreateViewOperation(java.lang.String databaseName,
java.lang.String viewName,
java.lang.String viewOn,
java.util.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.
|
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
|
Collation |
getCollation()
Gets the default collation for the view
|
java.lang.String |
getDatabaseName()
Gets the database name
|
java.util.List<BsonDocument> |
getPipeline()
Gets the pipeline that defines the view.
|
java.lang.String |
getViewName()
Gets the name of the view to create.
|
java.lang.String |
getViewOn()
Gets the name of the collection or view that backs this view.
|
WriteConcern |
getWriteConcern()
Gets the write concern.
|
public CreateViewOperation(java.lang.String databaseName, java.lang.String viewName, java.lang.String viewOn, java.util.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 java.lang.String getDatabaseName()
public java.lang.String getViewName()
public java.lang.String getViewOn()
public java.util.List<BsonDocument> getPipeline()
public WriteConcern getWriteConcern()
public Collation getCollation()
public CreateViewOperation collation(Collation collation)
collation
- the collation, which may be nullpublic java.lang.Void execute(WriteBinding binding)
WriteOperation
execute
in interface WriteOperation<java.lang.Void>
binding
- the binding to execute in the context ofpublic void executeAsync(AsyncWriteBinding binding, SingleResultCallback<java.lang.Void> callback)
AsyncWriteOperation
executeAsync
in interface AsyncWriteOperation<java.lang.Void>
binding
- the binding to execute in the context ofcallback
- the callback to be called when the operation has been executed