Click or drag to resize

MongoDatabaseBaseCreateViewAsyncTDocument, TResult Method (IClientSessionHandle, String, String, PipelineDefinitionTDocument, TResult, CreateViewOptionsTDocument, CancellationToken)

Creates a view.

Namespace:  MongoDB.Driver
Assembly:  MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.19.1+3a2a09dd959482f665ffbb5df2557ec541597af4
Syntax
public virtual Task CreateViewAsync<TDocument, TResult>(
	IClientSessionHandle session,
	string viewName,
	string viewOn,
	PipelineDefinition<TDocument, TResult> pipeline,
	CreateViewOptions<TDocument> options = null,
	CancellationToken cancellationToken = default
)

Parameters

session
Type: MongoDB.DriverIClientSessionHandle
The session.
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.

Implements

IMongoDatabaseCreateViewAsyncTDocument, TResult(IClientSessionHandle, String, String, PipelineDefinitionTDocument, TResult, CreateViewOptionsTDocument, CancellationToken)
See Also