Table of Contents

Method ListCollections

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

ListCollections(ListCollectionsOptions, CancellationToken)

Lists all the collections in the database.

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

Parameters

options ListCollectionsOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<BsonDocument>

A cursor.

ListCollections(IClientSessionHandle, ListCollectionsOptions, CancellationToken)

Lists all the collections in the database.

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

Parameters

session IClientSessionHandle

The session.

options ListCollectionsOptions

The options.

cancellationToken CancellationToken

The cancellation token.

Returns

IAsyncCursor<BsonDocument>

A cursor.