Mariadb 如何使用sequelize删除行
我正在使用sequelize。Mariadb 如何使用sequelize删除行,mariadb,sequelize.js,Mariadb,Sequelize.js,我正在使用sequelize。 const total = await models.parcel.findAndCountAll({ group: ['status'] }); 我得到了这个响应。但我只想计算响应中的行数。 我怎么做这个?非常感谢你阅读我的问题 { "count": [ { "status": null, "count": 8 }, { "statu
const total = await models.parcel.findAndCountAll({ group: ['status'] });
我得到了这个响应。但我只想计算响应中的行数。
我怎么做这个?非常感谢你阅读我的问题
{
"count": [
{
"status": null,
"count": 8
},
{
"status": "1",
"count": 5
},
{
"status": "2",
"count": 3
}
],
"rows": [
{
"id": 3,
"companyName": "hy",
"invoice": "904103",
"receiverName": "Rtrt",
},......
]
}
只需将
findAndCountAll
更改为count
:
await models.parcel.findAndCountAll({ group: ['status'] });
致:
只需将FindCountAll更改为count and check。参考链接:
await models.parcel.count({ group: ['status'] });