On this page, you'll learn how to connect to your MongoDB deployment using the MongoDB for IntelliJ Plugin.
Note
MongoDB Atlas
If you need to create a MongoDB host, consider using MongoDB Atlas. Atlas is a cloud-hosted database-as-a-service which requires no installation, offers a free tier to get started, and provides a copyable URI to easily connect the IntelliJ Plugin to your deployment.
Before You Begin
Ensure that an instance of MongoDB is running and the IntelliJ Plugin is installed.
If you are using the MongoDB Java driver, use the Java driver version 5.0.0+. If you are using Spring Criteria MongoDB use Spring Data MongoDB version 4.3.0+.
Steps
Add a MongoDB connection.
To open the Data Sources and Drivers modal, click Add a MongoDB Data Source.
Paste your connection string directly in the URL field near the bottom of the Data Sources and Drivers tab.
Ensure that your connection string specifies the port that your instance is running on.
Click OK.
View insights for your MongoDB deployment.
After you connect to your deployment, you can see all the generated insights for your workspace, which include index performance warnings and validation errors.

The IntelliJ Plugin includes four options to view your Insights:
All insights: Includes insights for all packages in your workspace.
Recommended Insights: Includes insights for the most common parent package of files opened in the IDE. This ensures that insights are relevant to all files and their shared context within the broader structure of your application.
Current File: Includes insights only from the currently open file.
Current Query: Includes insights for the query where the keyboard cursor is located.
Select a data source in the side panel.
You can select a data source associated with your application from within MongoDB side panel.
The side panel has a Connected to drop-down menu that allows you to select a data source associated with your application.
For the best experience, the data source you select should contain the following:
All of the databases, collection, and fields your application code uses.
All of the indexes used by your queries.