Optional options: CreateIndexesOptionsDoes a dry-run of Model.syncIndexes(), meaning that the result of this function would be the result of Model.syncIndexes().
Optional options: Record<string, unknown>Sends createIndex commands to mongo for each index declared in the schema.
The createIndex commands are sent in series.
Optional options: CreateIndexesOptionsLists the indexes currently defined in MongoDB. This may or may not be
the same as the indexes defined in your schema depending on whether you
use the autoIndex option and if you
build indexes manually.
Makes the indexes in MongoDB match the indexes defined in this model's
schema. This function will drop any indexes that are not defined in
the model's schema except the _id index, and build any indexes that
are in your schema but not in MongoDB.
Optional options: SyncIndexesOptions
Similar to
ensureIndexes(), except for it uses thecreateIndexfunction.