从Google App Engine标准连接到MongoDB Atlas

时间:2018-10-30 17:33:03

标签: mongodb google-app-engine

我可以使用3.4+驱动程序成功连接到Google App Engine Standard(Node.js 8运行时)从mLab托管的MongoDB数据库。

但是我无法使用3.6+驱动程序和3.4+驱动程序从Google App Engine标准(Node.js 8运行时)连接到MongoDB Atlas上托管的MongoDB数据库。 3.4+驱动程序在失效前会工作一段时间。

我收到错误消息“错误:querySrv ESERVFAIL _mongodb._tcp.xyz-wc7dj.gcp.mongodb.net”

3.6+驱动程序连接字符串:

mongodb+srv://username:password@xyz-wc7dj.gcp.mongodb.net/dbname?retryWrites=true

3.4+驱动程序连接字符串

mongodb://username:password@xyz-shard-00-00-wc7dj.gcp.mongodb.net:27017,xyz-shard-00-01-wc7dj.gcp.mongodb.net:27017,xyz-shard-00-02-wc7dj.gcp.mongodb.net:27017/dbname?ssl=true&replicaSet=xyz-shard-0&authSource=admin&retryWrites=true

请帮助!

0 个答案:

没有答案