Table of Contents

Method ListCollectionNamesAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ListCollectionNamesAsync(ListCollectionNamesOptions, CancellationToken)

Lists the names of all the collections in the database.

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

Parameters

options ListCollectionNamesOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<string>>

A Task whose result is a cursor.

ListCollectionNamesAsync(IClientSessionHandle, ListCollectionNamesOptions, CancellationToken)

Lists the names of all the collections in the database.

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

Parameters

session IClientSessionHandle

The session.

options ListCollectionNamesOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<string>>

A Task whose result is a cursor.