Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to connect mongodb atlas to intellij MongoExplorer

I'm using mongodb atlas for my backend and I'm trying to connect it to Mongo Explorer of intellij

This is the first image for furthur details

I have replaced the <PASSWORD> with actual database password

This is the second image where I provided the database username and password but still I'm not able to connect.

Error image

I have connected to localhost very easily without any problems but this is not connecting...

I'm using Intellij Idea Ultimate 2017.1.3 with student license. I think there is no problem with this particular license and Ide version

Thanks in advance :)

like image 640
Bharat Avatar asked Oct 30 '22 05:10

Bharat


1 Answers

It is very easy steps:

  1. Add these Dependencies in pom.xml file :

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-mongodb</artifactId>
    </dependency>
    

  2. You want to add this code to application.properties file :

     spring.data.mongodb.uri= your_uri_here
     spring.data.mongodb.database= database_name_here
    

enter image description here

enter image description here

like image 176
Manchanayakage Shalika Prasad Avatar answered Nov 15 '22 07:11

Manchanayakage Shalika Prasad