IndexModel.add

Adds a single field or multikey index with a direction.

Call this method multiple times with different fields to create a compound index.

  1. IndexModel add(string field, int direction)
    struct IndexModel
    ref return @safe
    add
    (
    string field
    ,)
  2. IndexModel add(string field, string type)

Parameters

field string

the name of the field to index

direction int

1 for ascending or -1 for descending

Return Value

this IndexModel instance (caller)

Meta