Docs Menu
Docs Home
/
MongoDB for IntelliJ Plugin

Connect to Your MongoDB Deployment

On this page

  • Before You Begin
  • Steps
  • Next Steps
  • Learn More

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.

Ensure that an instance of MongoDB is running and the IntelliJ Plugin is installed.

1

To show the Database tab, click the Database Explorer icon on the far-right menu bar of IntelliJ.

Click the Database Explorer icon.
2

Click the + icon, then click Data Source and select MongoDB from the drop-down menu.

Click the + button > Data Source > MongoDB.
3

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.

4

Find the connected MongoDB data source in Database Explorer.

You can load as many databases as you’d like by clicking on 1 of 11 text as shown in the following image.

Select the databases to load.
5

The Connections Toolbar is a feature of the MongoDB for IntelliJ Plugin that allows you to select a data source associated with your application from within the editor window.

When you open a file that contains MongoDB code, a toolbar appears at the top of the file as shown in the following image.

The Connections Toolbar appears at the top of the file.

This toolbar has a 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.

6

To launch the Playgrounds, click the highlighted button in Database Explorer.

To launch the Playgrounds, click the highlighted button in Database Explorer.

Back

Install