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