Method ListCollectionsAsync
ListCollectionsAsync(ListCollectionsOptions, CancellationToken)
Lists all the collections in the database.
public abstract Task<IAsyncCursor<BsonDocument>> ListCollectionsAsync(ListCollectionsOptions options = null, CancellationToken cancellationToken = default)
Parameters
options
ListCollections Options The options.
cancellationToken
CancellationToken The cancellation token.
Returns
- Task<IAsync
Cursor <BsonDocument >> A Task whose result is a cursor.
ListCollectionsAsync(IClientSessionHandle, ListCollectionsOptions, CancellationToken)
Lists all the collections in the database.
public virtual Task<IAsyncCursor<BsonDocument>> ListCollectionsAsync(IClientSessionHandle session, ListCollectionsOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSession Handle The session.
options
ListCollections Options The options.
cancellationToken
CancellationToken The cancellation token.
Returns
- Task<IAsync
Cursor <BsonDocument >> A Task whose result is a cursor.