Table of Contents

Interface IMongoDatabase

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Represents a database in MongoDB.

public interface IMongoDatabase
Extension Methods

Properties

Client

Gets the client.

DatabaseNamespace

Gets the namespace of the database.

Settings

Gets the settings.

Methods

AggregateAsync<TResult>(IClientSessionHandle, PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

AggregateAsync<TResult>(PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

AggregateToCollectionAsync<TResult>(IClientSessionHandle, PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

AggregateToCollectionAsync<TResult>(PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

AggregateToCollection<TResult>(IClientSessionHandle, PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

AggregateToCollection<TResult>(PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

Aggregate<TResult>(IClientSessionHandle, PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

Aggregate<TResult>(PipelineDefinition<NoPipelineInput, TResult>, AggregateOptions, CancellationToken)

Runs an aggregation pipeline.

CreateCollection(IClientSessionHandle, string, CreateCollectionOptions, CancellationToken)

Creates the collection with the specified name.

CreateCollection(string, CreateCollectionOptions, CancellationToken)

Creates the collection with the specified name.

CreateCollectionAsync(IClientSessionHandle, string, CreateCollectionOptions, CancellationToken)

Creates the collection with the specified name.

CreateCollectionAsync(string, CreateCollectionOptions, CancellationToken)

Creates the collection with the specified name.

CreateViewAsync<TDocument, TResult>(IClientSessionHandle, string, string, PipelineDefinition<TDocument, TResult>, CreateViewOptions<TDocument>, CancellationToken)

Creates a view.

CreateViewAsync<TDocument, TResult>(string, string, PipelineDefinition<TDocument, TResult>, CreateViewOptions<TDocument>, CancellationToken)

Creates a view.

CreateView<TDocument, TResult>(IClientSessionHandle, string, string, PipelineDefinition<TDocument, TResult>, CreateViewOptions<TDocument>, CancellationToken)

Creates a view.

CreateView<TDocument, TResult>(string, string, PipelineDefinition<TDocument, TResult>, CreateViewOptions<TDocument>, CancellationToken)

Creates a view.

DropCollection(IClientSessionHandle, string, DropCollectionOptions, CancellationToken)

Drops the collection with the specified name.

DropCollection(IClientSessionHandle, string, CancellationToken)

Drops the collection with the specified name.

DropCollection(string, DropCollectionOptions, CancellationToken)

Drops the collection with the specified name.

DropCollection(string, CancellationToken)

Drops the collection with the specified name.

DropCollectionAsync(IClientSessionHandle, string, DropCollectionOptions, CancellationToken)

Drops the collection with the specified name.

DropCollectionAsync(IClientSessionHandle, string, CancellationToken)

Drops the collection with the specified name.

DropCollectionAsync(string, DropCollectionOptions, CancellationToken)

Drops the collection with the specified name.

DropCollectionAsync(string, CancellationToken)

Drops the collection with the specified name.

GetCollection<TDocument>(string, MongoCollectionSettings)

Gets a collection.

ListCollectionNames(IClientSessionHandle, ListCollectionNamesOptions, CancellationToken)

Lists the names of all the collections in the database.

ListCollectionNames(ListCollectionNamesOptions, CancellationToken)

Lists the names of all the collections in the database.

ListCollectionNamesAsync(IClientSessionHandle, ListCollectionNamesOptions, CancellationToken)

Lists the names of all the collections in the database.

ListCollectionNamesAsync(ListCollectionNamesOptions, CancellationToken)

Lists the names of all the collections in the database.

ListCollections(IClientSessionHandle, ListCollectionsOptions, CancellationToken)

Lists all the collections in the database.

ListCollections(ListCollectionsOptions, CancellationToken)

Lists all the collections in the database.

ListCollectionsAsync(IClientSessionHandle, ListCollectionsOptions, CancellationToken)

Lists all the collections in the database.

ListCollectionsAsync(ListCollectionsOptions, CancellationToken)

Lists all the collections in the database.

RenameCollection(IClientSessionHandle, string, string, RenameCollectionOptions, CancellationToken)

Renames the collection.

RenameCollection(string, string, RenameCollectionOptions, CancellationToken)

Renames the collection.

RenameCollectionAsync(IClientSessionHandle, string, string, RenameCollectionOptions, CancellationToken)

Renames the collection.

RenameCollectionAsync(string, string, RenameCollectionOptions, CancellationToken)

Renames the collection.

RunCommandAsync<TResult>(Command<TResult>, ReadPreference, CancellationToken)

Runs a command.

RunCommandAsync<TResult>(IClientSessionHandle, Command<TResult>, ReadPreference, CancellationToken)

Runs a command.

RunCommand<TResult>(Command<TResult>, ReadPreference, CancellationToken)

Runs a command.

RunCommand<TResult>(IClientSessionHandle, Command<TResult>, ReadPreference, CancellationToken)

Runs a command.

WatchAsync<TResult>(IClientSessionHandle, PipelineDefinition<ChangeStreamDocument<BsonDocument>, TResult>, ChangeStreamOptions, CancellationToken)

Watches changes on all collections in a database.

WatchAsync<TResult>(PipelineDefinition<ChangeStreamDocument<BsonDocument>, TResult>, ChangeStreamOptions, CancellationToken)

Watches changes on all collections in a database.

Watch<TResult>(IClientSessionHandle, PipelineDefinition<ChangeStreamDocument<BsonDocument>, TResult>, ChangeStreamOptions, CancellationToken)

Watches changes on all collections in a database.

Watch<TResult>(PipelineDefinition<ChangeStreamDocument<BsonDocument>, TResult>, ChangeStreamOptions, CancellationToken)

Watches changes on all collections in a database.

WithReadConcern(ReadConcern)

Returns a new IMongoDatabase instance with a different read concern setting.

WithReadPreference(ReadPreference)

Returns a new IMongoDatabase instance with a different read preference setting.

WithWriteConcern(WriteConcern)

Returns a new IMongoDatabase instance with a different write concern setting.