.map在这里很方便:
loadActiveChannels: function() { return Knex('game_channels as ch') .where('ch.channel_state', '>', 0) .map(function(channel) { return redis.hmsetAsync("channel:"+channel.channel_id, _.omit(channel, 'channel_id')) }).then(function(res) { console.log(res); })}您的原始代码未获得任何输出的原因是因为您
promises.push[promise];应该拥有
promises.push(promise)



