Table of Contents

Method ListDatabaseNamesAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ListDatabaseNamesAsync(CancellationToken)

Returns the names of the databases on the server.

public Task<IAsyncCursor<string>> ListDatabaseNamesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<string>>

The database names.

ListDatabaseNamesAsync(ListDatabaseNamesOptions, CancellationToken)

Returns the names of the databases on the server.

public Task<IAsyncCursor<string>> ListDatabaseNamesAsync(ListDatabaseNamesOptions options, CancellationToken cancellationToken = default)

Parameters

options ListDatabaseNamesOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<string>>

The database names.

ListDatabaseNamesAsync(IClientSessionHandle, CancellationToken)

Returns the names of the databases on the server.

public Task<IAsyncCursor<string>> ListDatabaseNamesAsync(IClientSessionHandle session, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<string>>

The database names.

ListDatabaseNamesAsync(IClientSessionHandle, ListDatabaseNamesOptions, CancellationToken)

Returns the names of the databases on the server.

public Task<IAsyncCursor<string>> ListDatabaseNamesAsync(IClientSessionHandle session, ListDatabaseNamesOptions options, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

options ListDatabaseNamesOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<string>>

The database names.