dropCollection method

Future<bool> dropCollection(
  1. String collectionName
)

Implementation

Future<bool> dropCollection(String collectionName) async {
  if (masterConnection.serverCapabilities.supportsOpMsg) {
    var result = await modernDrop(collectionName);
    return result[keyOk] == 1.0;
  }
  var collectionInfos = await getCollectionInfos({'name': collectionName});

  if (collectionInfos.length == 1) {
    return executeDbCommand(
            DbCommand.createDropCollectionCommand(this, collectionName))
        .then((_) => true);
  }

  return true;
}