MongoDB indexes

When you create a new index for MongoDB collection in Moon Modeler, the Index Assistant window will appear.

index assistant for mongodb indexes

Indexes can be defined easily. Just select the fields, either from the drop down element:

mongodb index creation

or by typing the field name directly. The auto-completion feature is available for you.

fields in mongodb index

Click the Add button to insert the field to the index.

adding a new field to the index

Then use the user interface to comfortably set up:

  • options for all indexes
  • options for text indexes
  • options for 2dsphere indexes
  • options for wildcard indexes
mongodb index options
  • and the collation as well
collation

In addition, you can modify or refine everything with your own code on tab Code.
The preview of the resulting createIndex statement is displayed on the last tab of the Index Assistant window.

mongodb createindex statement

Generated code for MongoDB indexes

The script for creating indexes is included in the generated script for the project. You can find it below the script generated for the collection.

generated script

HTML reports and MongoDB indexes

MongoDB indexes are also included in the interactive HTML reports.

mongodb index detail in HTML report