Table of Contents

Method ListCollectionsAsync

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ListCollectionsAsync(ListCollectionsOptions, CancellationToken)

Lists all the collections in the database.

Task<IAsyncCursor<BsonDocument>> ListCollectionsAsync(ListCollectionsOptions options = null, CancellationToken cancellationToken = default)

Parameters

options ListCollectionsOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<BsonDocument>>

A Task whose result is a cursor.

ListCollectionsAsync(IClientSessionHandle, ListCollectionsOptions, CancellationToken)

Lists all the collections in the database.

Task<IAsyncCursor<BsonDocument>> ListCollectionsAsync(IClientSessionHandle session, ListCollectionsOptions options = null, CancellationToken cancellationToken = default)

Parameters

session IClientSessionHandle

The session.

options ListCollectionsOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<IAsyncCursor<BsonDocument>>

A Task whose result is a cursor.