IndexModel.add - multiple declarations
Function 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.
Parameters
Name | Description |
---|---|
field | the name of the field to index |
direction | 1 for ascending or -1 for descending |
Returns
this IndexModel instance (caller)
Function IndexModel.add
Adds an index with a given index type. Use IndexType
for a type-safe
setting of the string.
Parameters
Name | Description |
---|---|
field | the name of the field to index |
type | the index type to use |
Returns
this IndexModel instance (caller)