我想返回在另一個變量中的sequelize query
的值。我對試圖不同的解決方案,但我有同樣的結果:sequelize query return Promise {_bitField:...}
Promise {
_bitField: 2097152,
_fulfillmentHandler0: undefined,
_rejectionHandler0: undefined,
_promise0: undefined,
_receiver0: undefined,
_boundTo: SellerPresent }
我的js文件(目前):
function findIdSeller(selectEvent) {
var match = {attribute: ['seller_id'], where: {event_id: selectEvent}, raw: true};
return models.SellerPresent.findAll(match)}
exports.findDataSeller = function (selectEvent) {
var seller = [];
return findIdSeller(selectEvent).then(function (result) {
return seller.push(result.seller_id)
})
};
我需要在路線導出此數據。我怎麼能做到這一點?
[如何返回從一個異步調用的響應?](HTTPS的可能重複: //stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call) –