mongoose数据库怎么同步读取数据?
 发布于 12 年前  作者 lsmsnail  7117 次预览  最后一次回复是 12 年前  来自  
var newOrderList = {shopPlace : String}
async.map(orderList,function(oneOrder,cb){
            Shop.findOne({'name': oneOrder.shopName},function(err,shop){
                newOrderList.shopPlace = shop.place;
                cb(null,newOrderList)
            })
        },function(err,results){
            res.render('userOrderRecord',{
                ,'orderList': results
            });
        })

上述代码回调函数中newOrderList得到的是同一个值,但我希望Shop读取数据库的过程是同步的,newOrderList传给results四个不同的值,有什么方法?