Method CreateIndex
- Namespace
- MongoDB.EntityFrameworkCore
- Assembly
- MongoDB.EntityFrameworkCore.dll
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.
public static void CreateIndex(this DatabaseFacade databaseFacade, IIndex index)
Parameters
databaseFacadeDatabaseFacadeThe DatabaseFacade from the EF Core DbContext.
indexIIndexThe IIndex definition.