createIndex method

Future<void> createIndex(
  1. String collection,
  2. List<String> fields
)

Creates a secondary index over fields of collection and backfills it from existing documents. A single-element list creates a plain index; two or more fields create a compound index in that significance order.

Implementation

Future<void> createIndex(String collection, List<String> fields) {
  _ensureOpen();
  return _track(() => _indexes.createCompoundIndex(collection, fields));
}