Table of Contents

Class CreateViewOperation

Namespace
MongoDB.Driver.Core.Operations
Assembly
MongoDB.Driver.Core.dll

Represents a create view operation.

public class CreateViewOperation : IWriteOperation<BsonDocument>
Inheritance
CreateViewOperation
Implements
Inherited Members
Extension Methods

Constructors

CreateViewOperation(DatabaseNamespace, string, string, IEnumerable<BsonDocument>, MessageEncoderSettings)

Initializes a new instance of the CreateCollectionOperation class.

public CreateViewOperation(DatabaseNamespace databaseNamespace, string viewName, string viewOn, IEnumerable<BsonDocument> pipeline, MessageEncoderSettings messageEncoderSettings)

Parameters

databaseNamespace DatabaseNamespace

The name of the database.

viewName string

The name of the view.

viewOn string

The name of the collection that the view is on.

pipeline IEnumerable<BsonDocument>

The pipeline.

messageEncoderSettings MessageEncoderSettings

The message encoder settings.

Properties

Collation

Gets or sets the collation.

public Collation Collation { get; set; }

Property Value

Collation

The collation.

DatabaseNamespace

Gets the namespace of the database.

public DatabaseNamespace DatabaseNamespace { get; }

Property Value

DatabaseNamespace

The namespace of the database.

MessageEncoderSettings

Gets the message encoder settings.

public MessageEncoderSettings MessageEncoderSettings { get; }

Property Value

MessageEncoderSettings

The message encoder settings.

Pipeline

Gets the pipeline.

public IReadOnlyList<BsonDocument> Pipeline { get; }

Property Value

IReadOnlyList<BsonDocument>

The pipeline.

ViewName

Gets the name of the view.

public string ViewName { get; }

Property Value

string

The name of the view.

ViewOn

Gets the name of the collection that the view is on.

public string ViewOn { get; }

Property Value

string

The name of the collection that the view is on.

WriteConcern

Gets or sets the write concern.

public WriteConcern WriteConcern { get; set; }

Property Value

WriteConcern

The write concern.

Methods

Execute(IWriteBinding, CancellationToken)

Executes the operation.

public BsonDocument Execute(IWriteBinding binding, CancellationToken cancellationToken)

Parameters

binding IWriteBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

BsonDocument

The result of the operation.

ExecuteAsync(IWriteBinding, CancellationToken)

Executes the operation.

public Task<BsonDocument> ExecuteAsync(IWriteBinding binding, CancellationToken cancellationToken)

Parameters

binding IWriteBinding

The binding.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<BsonDocument>

A Task whose result is the result of the operation.