Table of Contents

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

databaseFacade DatabaseFacade

The DatabaseFacade from the EF Core DbContext.

index IIndex

The IIndex definition.