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]})