Table of Contents

Method ListDatabasesAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ListDatabasesAsync(CancellationToken)

Lists the databases on the server.

public Task<IAsyncCursor<BsonDocument>> ListDatabasesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<BsonDocument>>

A Task whose result is a cursor.

ListDatabasesAsync(ListDatabasesOptions, CancellationToken)

Lists the databases on the server.

public Task<IAsyncCursor<BsonDocument>> ListDatabasesAsync(ListDatabasesOptions options, CancellationToken cancellationToken = default)

Parameters

options ListDatabasesOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<BsonDocument>>

A Task whose result is a cursor.

ListDatabasesAsync(IClientSessionHandle, CancellationToken)

Lists the databases on the server.

public Task<IAsyncCursor<BsonDocument>> ListDatabasesAsync(IClientSessionHandle session, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<BsonDocument>>

A Task whose result is a cursor.

ListDatabasesAsync(IClientSessionHandle, ListDatabasesOptions, CancellationToken)

Lists the databases on the server.

public Task<IAsyncCursor<BsonDocument>> ListDatabasesAsync(IClientSessionHandle session, ListDatabasesOptions options, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

options ListDatabasesOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<BsonDocument>>

A Task whose result is a cursor.