dropIndexes method

Future<Map<String, dynamic>> dropIndexes(
  1. Object index, {
  2. WriteConcern? writeConcern,
  3. String? comment,
  4. Map<String, Object>? rawOptions,
})

Implementation

Future<Map<String, dynamic>> dropIndexes(Object index,
    {WriteConcern? writeConcern,
    String? comment,
    Map<String, Object>? rawOptions}) {
  if (!db.masterConnection.serverCapabilities.supportsOpMsg) {
    throw MongoDartError('dropIndexes method cannot be used before 3.6');
  }

  var indexOptions =
      DropIndexesOptions(writeConcern: writeConcern, comment: comment);

  var command = DropIndexesCommand(db, this, index,
      dropIndexesOptions: indexOptions, rawOptions: rawOptions);

  return command.execute();
}