问题描述
我尝试使用以下配置:
在datastores.js
中,我尝试过
adapter: 'sails-mongo',url: 'mongodb+srv://[email protected]/xyz?retryWrites=true&w=majority',ssl: true
以上URL用于MongoDB地图集
在model.js
id: { type: 'string',columnName: '_id' }
npm install sails-mongo
仍然无法连接到我的“ MongoDB”
我正在使用"sails": "^1.2.4"
,"sails-mongo": "^1.2.0"
我想告诉您,我能够使用Mongoose
适配器连接到同一实例。
我遇到的错误如下-
A hook (`orm`) failed to load!
Could not tear down the ORM hook. Error details: Error: Consistency violation: Attempting to tear
down a datastore (`default`) which is not currently registered with this adapter. This is usually
due to a race condition in userland code (e.g. attempting to tear down the same ORM instance more
than once),or it could be
due to a bug in this adapter. (If you get stumped,reach out at http://sailsjs.com/support.)
Error: Consistency violation: Unexpected error creating db connection manager:
MongoError: failed to connect to server [cluster0.uzpih.mongodb.net:27017] on first connect
[MongoError: getaddrinfo ENOTFOUND cluster0.uzpih.mongodb.net cluster0.uzpih.mongodb.net:27017]
请建议我在哪里做错了!预先感谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)