0

このコードの各FIND関数の結果をマージできません:

this.result = [];
    _products.find().exec(function (err,products) {
        this.products = products;
        var productsCollection = [];
        for(i=0;i<products.length;i++) {
            _prices.find({uname:products[i].uname},function(err,prices){

                var resultItem = {product:products[i],prices:prices}
                this.result.push(resultItem)
            }.bind(this))

        }
            res.json(200, this.result);
    }.bind(this) );

エラーはありません...しかし、応答は空の配列です:(

助けてください...どうすれば結果をマージできますか?

4

1 に答える 1