async function _dropIndexes(toDrop, model, options) {
  if (toDrop.length === 0) {
    return [];
  }

  const collection = model.$__collection;
  if (options && options.hideIndexes) {
    await Promise.all(toDrop.map(indexName => {
      return model.db.db.command({
        collMod: collection.collectionName,
        index: { name: indexName, hidden: true }
      });
    }));
  } else {
    await Promise.all(toDrop.map(indexName => collection.dropIndex(indexName)));
  }

  return toDrop;
}
Deletes all indexes that aren't defined in this model's schema. Used by
`syncIndexes()`.

The returned promise resolves to a list of the dropped indexes' names as an array

@param {Object} [options]
@param {Array<String>} [options.toDrop] if specified, contains a list of index names to drop
@param {Boolean} [options.hideIndexes=false] set to `true` to hide indexes instead of dropping. Requires MongoDB server 4.4 or higher
@return {Promise<Array<String>>} list of dropped or hidden index names
@api public