简体   繁体   English

返回多个Sequelize查询的结果

[英]returning results of multiple Sequelize queries

my endpoint needs to return the results of multiple sequelize.query() statements that use multiple tables. 我的端点需要返回使用多个表的多个sequelize.query()语句的结果。 how do I ensure that all the statements have executed befire building the JSON? 如何确保在构建JSON之前执行所有语句?

你可以使用查询连锁.then()但使用Promise.all()可能会更好,特别是如果你有很多疑问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM