MongoDB Indexes

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

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.



Got any MongoDB Question?