Click or drag to resize
IMongoDatabase.CreateViewAsync<TDocument, TResult> Method
Creates a view.

Namespace: MongoDB.Driver
Assembly: MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.4.1
Syntax
Task CreateViewAsync<TDocument, TResult>(
	string viewName,
	string viewOn,
	PipelineDefinition<TDocument, TResult> pipeline,
	CreateViewOptions<TDocument> options = null,
	CancellationToken cancellationToken = null
)

Parameters

viewName
Type: System.String
The name of the view.
viewOn
Type: System.String
The name of the collection that the view is on.
pipeline
Type: MongoDB.Driver.PipelineDefinition<TDocument, TResult>
The pipeline.
options (Optional)
Type: MongoDB.Driver.CreateViewOptions<TDocument>
The options.
cancellationToken (Optional)
Type: System.Threading.CancellationToken
The cancellation token.

Type Parameters

TDocument
The type of the input documents.
TResult
The type of the pipeline result documents.

Return Value

Type: Task
A task.
See Also