MongoDB Indexes Single field


Example

db.people.createIndex({name: 1})

This creates an ascending single field index on the field name.

In this type of indexes the sort order is irrelevant, because mongo can traverse the index in both directions.