node.js - 水线: Trying to access a collection string that is not defined

标签 node.js orm sails.js waterline

我将 Waterline 与 Sails.js 结合使用。

我想要一个具有参与用户。一个事件可以有多个参与参与具有状态。

我的用户类别:

module.exports = {

attributes: {
    involvements: {
        collection: 'Involvement',
        via : 'user'
    }
}
};

我的事件类(class):

module.exports = {

attributes: {
    creator: {
        model: 'User'
    },
    involvements: {
        collection: 'Involvement',
        via: 'event'
    }
}
};

我的参与类(class):

module.exports = {

attributes: {
    status: {
        type: 'string',
        required: true
    },
    user : {
        model : 'User'
    },
    event : {
        model : 'Event'
    }
}
};

当我尝试启动服务器时出现此错误:

Trying to access a collection string that is not defined.

最佳答案

尝试将 Sails 更新到较新的版本。我在 Sails 0.11.0 上尝试过,效果很好,所以我猜测循环关系可能存在问题。

npm 更新 sails

或者如果它是全局安装的:

sudo npm update -g sails

关于node.js - 水线: Trying to access a collection string that is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31574476/

相关文章:

javascript - 在所有全局 javascript 后将 javascript 注入(inject)到 Sailsjs 中的特定 View /路由

javascript - MongoDB - $set 更新或推送数组元素

javascript - create-react-app 中的 "npm run build"是什么?

c# - 有充分的理由不使用 ORM 吗?

orm - 使用 JPQL 限制子查询

node.js - 在 nodeMailer 中设置附件路径的正确方法是什么?

Node.js express rest + Backbone 样板 (BBB)

Node : Specify files to unzip with zlib + tar

php - kohana中的继承

node.js - 在sails.js 中创建配置变量?