【发布时间】:2020-07-19 06:59:06
【问题描述】:
我有一个带有MongoDB 数据库的工作网络应用程序。我的应用正在获取/发布信息到在本地主机上运行的数据库中
const db = monk('localhost/datbaseName') //create/connect to database 'databaseName'
const posts = db.get('posts') //created a collection named 'posts' in 'databaseName'
我最近在mongoDB Atlas 上设置了一个数据库Cluster。现在有没有办法将我的代码连接到Atlas cluster 数据库,而不是使用localhost/datbaseName?
【问题讨论】:
标签: node.js mongodb hosting connection-string mongodb-atlas