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 a MongoDB search index, MongoDB vector search index, or a regular 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 a MongoDB search index, MongoDB vector index, or a regular 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-search and non-vector search 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-search and non-vector search indexes.

CreateMissingSearchIndexes(DatabaseFacade)

Creates missing MongoDB search 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.

CreateMissingSearchIndexesAsync(DatabaseFacade, CancellationToken)

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

CreateMissingVectorIndexes(DatabaseFacade)

Creates missing MongoDB 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 MongoDB 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.

WaitForSearchIndexes(DatabaseFacade, TimeSpan?)

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

WaitForSearchIndexesAsync(DatabaseFacade, TimeSpan?, CancellationToken)

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

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.