Table of Contents

Method CreateCollection

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

CreateCollection(string, CreateCollectionOptions, CancellationToken)

Creates the collection with the specified name.

public virtual void CreateCollection(string name, CreateCollectionOptions options = null, CancellationToken cancellationToken = default)

Parameters

name string

The name.

options CreateCollectionOptions

The options.

cancellationToken CancellationToken

The cancellation token.

CreateCollection(IClientSessionHandle, string, CreateCollectionOptions, CancellationToken)

Creates the collection with the specified name.

public virtual void CreateCollection(IClientSessionHandle session, string name, CreateCollectionOptions options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

name string

The name.

options CreateCollectionOptions

The options.

cancellationToken CancellationToken

The cancellation token.