indexInformation method

  1. @Deprecated('Use `DbCollection.getIndexes()` instead')
Future<List> indexInformation([
  1. String? collectionName
])

This method uses system collections and therefore do not work on MongoDB v3.0 with and upward with WiredTiger Use DbCollection.getIndexes() instead

Implementation

@Deprecated('Use `DbCollection.getIndexes()` instead')
Future<List> indexInformation([String? collectionName]) {
  var selector = {};

  if (collectionName != null) {
    selector['ns'] = '$databaseName.$collectionName';
  }

  return Cursor(this, DbCollection(this, DbCommand.SYSTEM_INDEX_COLLECTION),
          selector)
      .stream
      .toList();
}