node.js - 无法将 mongodb atlas 连接到 intellij MongoExplorer

标签 node.js mongodb intellij-idea mongodb-atlas

我正在为我的后端使用 mongodb atlas,我正在尝试将它连接到 intellij 的 Mongo Explorer

这是进一步细节的第一张图片

I have replaced the <PASSWORD> with actual database password

这是我提供数据库用户名和密码但仍然无法连接的第二张图片。

Error image

我已经非常轻松地连接到本地主机,没有任何问题,但这没有连接...

我正在使用具有学生许可的 Intellij Idea Ultimate 2017.1.3。我认为这个特定的许可和Ide版本没有问题

提前致谢:)

最佳答案

这是非常简单的步骤:

  1. 在 pom.xml 文件中添加这些依赖项:

    <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. 您想将此代码添加到 application.properties 文件:

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

enter image description here

enter image description here

关于node.js - 无法将 mongodb atlas 连接到 intellij MongoExplorer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44888112/

相关文章:

java - 使用java的mongo驱动程序保存接口(interface)对象列表

node.js - 在node.js/mongoDB中更新时发送后无法设置 header

java - REST,Tomcat,Jersey,IntelliJ,产生 404

intellij-idea - PyCharm,如何更改快速文档窗口的字体

spring-boot - Intellij IDEA 2018.2 缺少 Spring Boot 运行仪表板

javascript - 如何通过管道传输到文件(NodeJS)

node.js - "The installer has encountered an unexpected error installing this package..."。是否可以在 Windows XP 上安装 Node.js (v0.10.15)?

MongoDB - 如何向用户添加查找和修改权限

node.js - GatsbyJS/ReactJS 未正确代理请求

javascript - 如何从 Node 中的 require 等命令将 babel 选项传递给 @babel/register