Click or drag to resize

IMongoDatabaseCreateViewAsyncTDocument, TResult Method (String, String, PipelineDefinitionTDocument, TResult, CreateViewOptionsTDocument, CancellationToken)

Creates a view.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.13.1-v2-13-x1+a7f8afe27855f38f4f72157d11ba2ae73895502e
Syntax
Task CreateViewAsync<TDocument, TResult>(
	string viewName,
	string viewOn,
	PipelineDefinition<TDocument, TResult> pipeline,
	CreateViewOptions<TDocument> options = null,
	CancellationToken cancellationToken = null
)

Parameters

viewName
Type: SystemString
The name of the view.
viewOn
Type: SystemString
The name of the collection that the view is on.
pipeline
Type: MongoDB.DriverPipelineDefinitionTDocument, TResult
The pipeline.
options (Optional)
Type: MongoDB.DriverCreateViewOptionsTDocument
The options.
cancellationToken (Optional)
Type: System.ThreadingCancellationToken
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