Bluebird Promise serial iteration, and resolve to modified array?

前端 未结 2 1545
无人及你
无人及你 2020-12-10 05:51

I have this promise that creates a new Item document if it\'s not found in the db, and then stores it in a previously created Collection document..

2条回答
  •  眼角桃花
    2020-12-10 06:04

    Bluebird now natively implements a mapSeries, see http://bluebirdjs.com/docs/api/promise.mapseries.html

    It also looks like Promise.each still returns the original array unfortunately in v3.x.x.

提交回复
热议问题