DBIndex constructor

DBIndex({
  1. String? key,
  2. Map<String, dynamic>? keys,
  3. bool? unique,
  4. bool? sparse,
  5. bool? background,
  6. bool? dropDups,
  7. Map<String, dynamic>? partialFilterExpression,
  8. String? name,
  9. bool? modernReply,
  10. Map? collation,
})

Creates a new database index configuration.

Parameters:

  • key - Single field to index (cannot be used with keys)
  • keys - Compound index field specification (cannot be used with key)
  • unique - Enforce uniqueness constraint
  • sparse - Create sparse index
  • background - Build index in background
  • dropDups - Drop duplicate documents (deprecated)
  • partialFilterExpression - Filter for partial index
  • name - Custom index name
  • modernReply - Use modern reply format
  • collation - Collation specification

Implementation

DBIndex({
  this.key,
  this.keys,
  this.unique,
  this.sparse,
  this.background,
  this.dropDups,
  this.partialFilterExpression,
  this.name,
  this.modernReply,
  this.collation,
});