Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/456.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript MySQL:连接表时获取除一列以外的所有列_Javascript_Node.js_Join_Sequelize.js - Fatal编程技术网

Javascript MySQL:连接表时获取除一列以外的所有列

Javascript MySQL:连接表时获取除一列以外的所有列,javascript,node.js,join,sequelize.js,Javascript,Node.js,Join,Sequelize.js,如何获取联接用户表中除一列以外的所有列 我希望password属性/列不会出现在承诺响应中。这不起作用,因为我在打电话 属性:{exclude:['password']} 在…上 DBTweet它没有属性密码。联接的表DBUser具有该属性 这是我目前的密码。我正在使用Sequelize ORM DBTweet.findAll({ include: [DBUser, DBComment], attributes: { exclude: ['password'] }}) .then(tweets

如何获取联接用户表中除一列以外的所有列

我希望
password
属性/列不会出现在承诺响应中。这不起作用,因为我在打电话
属性:{exclude:['password']}
在…上
DBTweet
它没有属性密码。联接的表
DBUser
具有该属性

这是我目前的密码。我正在使用Sequelize ORM

DBTweet.findAll({ include: [DBUser, DBComment], attributes: { exclude: ['password'] }})
.then(tweets => {
    res.status(200).json(tweets)
})
.catch(err => {
    printC(err)
    res.status(500).json({ error: err })
})
提前感谢

这是我的解决方案:

DBTweet.findAll({ include: [{ model: DBUser, attributes: { exclude: ['password'] } }, DBComment]})
这就是我的解决方案:

DBTweet.findAll({ include: [{ model: DBUser, attributes: { exclude: ['password'] } }, DBComment]})