MongoDBIndexes


Syntax

  • db.collection.createIndex({ <string field> : <1|-1 order> [, <string field> : <1|-1 order>] });

Remarks

Performance Impact: Note that indexes improve read performances, but can have bad impact on write performance, as inserting a document requires updating all indexes.