Quantcast
Channel: CNode:Node.js专业中文社区
Viewing all articles
Browse latest Browse all 14821

mysql怎样统计关联外键的数量,用Sequelize又怎样操作

$
0
0

/大意如下:(CRM:Sequelize,Promise 流程控制); user instance {id:xx,username:xx}; store instance{id:xx,storename:xx}; 一个user关联多个store; 我想查找user时统计store数量; ------------------------------------------/ user_condition = { include:{ model.user } } model.user.all(user_condition) /输出:/ [{ id:xx, username:xx Stores:[{ id:xx, storename:xx }] }] /怎样统计Stores的数量?/


Viewing all articles
Browse latest Browse all 14821

Trending Articles