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 an Atlas index or a normal MongoDB index.
public static void CreateIndex(this DatabaseFacade databaseFacade, IIndex index)
Parameters
databaseFacadeDatabaseFacadeThe DatabaseFacade from the EF Core DbContext.
indexIIndexThe IIndex definition.