Interface IndexManager

Hierarchy

Methods

  • Similar to ensureIndexes(), except for it uses the createIndex function.

    Parameters

    Returns Promise<void>

  • Does a dry-run of Model.syncIndexes(), meaning that the result of this function would be the result of Model.syncIndexes().

    Parameters

    • Optional options: Record<string, unknown>
      Optional

    Returns Promise<IndexesDiff>

  • Sends createIndex commands to mongo for each index declared in the schema. The createIndex commands are sent in series.

    Parameters

    Returns Promise<void>

  • Lists 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.

    Returns Promise<any[]>

  • 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.

    Parameters

    Returns Promise<string[]>

Generated using TypeDoc