Table of Contents

Class MongoDatabaseFacadeExtensions

Namespace
MongoDB.EntityFrameworkCore
Assembly
MongoDB.EntityFrameworkCore.dll

MongoDB-specific extension methods for the DatabaseFacade obtained from the EF Core DbContext

public static class MongoDatabaseFacadeExtensions
Inheritance
MongoDatabaseFacadeExtensions
Inherited Members

Methods

BeginTransaction(DatabaseFacade, TransactionOptions)

Begin a new transaction with the supplied transactionOptions.

BeginTransactionAsync(DatabaseFacade, TransactionOptions, CancellationToken)

Begin a new async transaction with the supplied transactionOptions.

CreateIndex(DatabaseFacade, IIndex)

Creates an index in MongoDB based on the EF Core IIndex definition. No attempt is made to check that the index does not already exist and can therefore be created. The index may be an Atlas index or a normal MongoDB index.

CreateIndexAsync(DatabaseFacade, IIndex, CancellationToken)

Creates an index in MongoDB based on the EF Core IIndex definition. No attempt is made to check that the index does not already exist and can therefore be created. The index may be an Atlas index or a normal MongoDB index.

CreateMissingIndexes(DatabaseFacade)

Creates indexes in the MongoDB database for all IIndex definitions in the EF Core model for which there is not already an index in the database. This method only creates regular, non-Atlas indexes.

CreateMissingIndexesAsync(DatabaseFacade, CancellationToken)

Creates indexes in the MongoDB database for all IIndex definitions in the EF Core model for which there is not already an index in the database. This method only creates regular, non-Atlas indexes.

CreateMissingVectorIndexes(DatabaseFacade)

Creates missing Atlas vector indexes in the MongoDB database for all IIndex definitions in the EF Core model for which there is not already an index in the database.

CreateMissingVectorIndexesAsync(DatabaseFacade, CancellationToken)

Creates missing Atlas vector indexes in the MongoDB database for all IIndex definitions in the EF Core model for which there is not already an index in the database.

EnsureCreated(DatabaseFacade, MongoDatabaseCreationOptions)

Ensures that the database for the context exists. If it exists, no action is taken. If it does not exist then the MongoDB database is created using the MongoDatabaseCreationOptions to determine what additional actions to take.

EnsureCreatedAsync(DatabaseFacade, MongoDatabaseCreationOptions, CancellationToken)

Asynchronously ensures that the database for the context exists. If it exists, no action is taken. If it does not exist then the MongoDB database is created using the MongoDatabaseCreationOptions to determine what additional actions to take.

WaitForVectorIndexes(DatabaseFacade, TimeSpan?)

Blocks until all vector indexes in the mapped collections are reporting the 'READY' state.

WaitForVectorIndexesAsync(DatabaseFacade, TimeSpan?, CancellationToken)

Blocks until all vector indexes in the mapped collections are reporting the 'READY' state.