Table of Contents

Method ListCollectionNames

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ListCollectionNames(ListCollectionNamesOptions, CancellationToken)

Lists the names of all the collections in the database.

IAsyncCursor<string> ListCollectionNames(ListCollectionNamesOptions options = null, CancellationToken cancellationToken = default)

Parameters

options ListCollectionNamesOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<string>

A cursor.

ListCollectionNames(IClientSessionHandle, ListCollectionNamesOptions, CancellationToken)

Lists the names of all the collections in the database.

IAsyncCursor<string> ListCollectionNames(IClientSessionHandle session, ListCollectionNamesOptions options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

options ListCollectionNamesOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<string>

A cursor.