function getIndexesToCreate(schema, schemaIndexes, dbIndexes, toDrop, options) {
  const toCreate = [];
  const indexOptionsToCreate = options?.indexOptionsToCreate ?? false;

  for (const [schemaIndexKeysObject, schemaIndexOptions] of schemaIndexes) {
    let found = false;

    const options = decorateDiscriminatorIndexOptions(schema, clone(schemaIndexOptions));

    for (const index of dbIndexes) {
      if (isDefaultIdIndex(index)) {
        continue;
      }
      if (
        isIndexEqual(schemaIndexKeysObject, options, index) &&
        !toDrop.includes(index.name)
      ) {
        found = true;
        break;
      }
    }

    if (!found) {
      if (indexOptionsToCreate) {
        toCreate.push([schemaIndexKeysObject, schemaIndexOptions]);
      } else {
        toCreate.push(schemaIndexKeysObject);
      }
    }
  }

  return toCreate;
}
Does a dry-run of `Model.syncIndexes()`, returning the indexes that `syncIndexes()` would drop and create if you were to run `syncIndexes()`.

#### Example:

    const { toDrop, toCreate } = await Model.diffIndexes();
    toDrop; // Array of strings containing names of indexes that `syncIndexes()` will drop
    toCreate; // Array of index specs containing the keys of indexes that `syncIndexes()` will create

@param {Object} [options]
@param {Boolean} [options.indexOptionsToCreate=false] If true, `toCreate` will include both the index spec and the index options, not just the index spec
@return {Promise<Object>} contains the indexes that would be dropped in MongoDB and indexes that would be created in MongoDB as `{ toDrop: string[], toCreate: string[] }`.