AsyncWriteOperation<Void>
, WriteOperation<Void>
public class CreateViewOperation extends Object implements AsyncWriteOperation<Void>, WriteOperation<Void>
Constructor | Description |
---|---|
CreateViewOperationโ(String databaseName,
String viewName,
String viewOn,
List<BsonDocument> pipeline,
WriteConcern writeConcern) |
Construct a new instance.
|
Modifier and Type | Method | 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)
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