Table of Contents

Method CreateView

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

CreateView<TDocument, TResult>(string, string, PipelineDefinition<TDocument, TResult>, CreateViewOptions<TDocument>, CancellationToken)

Creates a view.

void CreateView<TDocument, TResult>(string viewName, string viewOn, PipelineDefinition<TDocument, TResult> pipeline, CreateViewOptions<TDocument> options = null, CancellationToken cancellationToken = default)

Parameters

viewName string

The name of the view.

viewOn string

The name of the collection that the view is on.

pipeline PipelineDefinition<TDocument, TResult>

The pipeline.

options CreateViewOptions<TDocument>

The options.

cancellationToken CancellationToken

The cancellation token.

Type Parameters

TDocument

The type of the input documents.

TResult

The type of the pipeline result documents.

CreateView<TDocument, TResult>(IClientSessionHandle, string, string, PipelineDefinition<TDocument, TResult>, CreateViewOptions<TDocument>, CancellationToken)

Creates a view.

void CreateView<TDocument, TResult>(IClientSessionHandle session, string viewName, string viewOn, PipelineDefinition<TDocument, TResult> pipeline, CreateViewOptions<TDocument> options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

viewName string

The name of the view.

viewOn string

The name of the collection that the view is on.

pipeline PipelineDefinition<TDocument, TResult>

The pipeline.

options CreateViewOptions<TDocument>

The options.

cancellationToken CancellationToken

The cancellation token.

Type Parameters

TDocument

The type of the input documents.

TResult

The type of the pipeline result documents.