【发布时间】:2017-08-03 09:10:54
【问题描述】:
我尝试从 db 获取记录。
db.relations.findAll({where: {organisation: orgName}})
.then(found => {
console.log('Found relations by name: ', found[0].dataValues);
})
.catch(error => {
console.log('Error: ', error);
});
我只得到一条记录,但 db 有不止一条同名记录。
然后我尝试不带参数的 findAll
db.relations.findAll()
.then(found => {
console.log('Found relations by name: ', found[0].dataValues);
})
.catch(error => {
console.log('Error: ', error);
});
我又得到了一条 id=1 的记录
【问题讨论】:
标签: sequelize.js