SailsJS MongoDB数据库连接错误

时间:2017-08-22 04:04:47

标签: mongodb sails.js

我是SailsJS的新手。我正在尝试使用mongo创建数据库连接,但它显示错误,如此

A hook (`orm`) failed to load!
error: Error: Consistency violation: A model (`sleep`) references a datastore which cannot be found (`mongo`).
If this model definition has an explicit `connection` property, check that it is spelled correctly.
If not, check your default `connection` (usually located in `config/models.js`).
Finally, check that this connection (`mongo`) is valid as per http://sailsjs.org/documentation/reference/configuration/sails-config-connections.

1 个答案:

答案 0 :(得分:0)

您的模型正在连接到无效的连接'mongo'。

检查模型“睡眠”或config / models.js

中的连接