私はdbからレコードを取得しようとしています。sequelize findAll()はレコードを1つだけ返します
db.relations.findAll({where: {organisation: orgName}})
.then(found => {
console.log('Found relations by name: ', found[0].dataValues);
})
.catch(error => {
console.log('Error: ', error);
});
私はレコードを1つだけ取得しますが、dbには同じ名前のレコードが2つ以上あります。
それから私はのparams
db.relations.findAll()
.then(found => {
console.log('Found relations by name: ', found[0].dataValues);
})
.catch(error => {
console.log('Error: ', error);
});
なしのfindAllを試してみて、私はあなたがfound[0]
を使用して、配列の最初の値にアクセスしている再び= 1