var orderList = doc.orderList;
var orderShopList = new Array();
orderList.forEach(function(oneOrder){
Shop.findOne({'name': oneOrder.shopName},function(err,shop){
orderShopList[orderShopList.length] = shop;
console.log(orderShopList);//有数值
})
})
console.log(orderShopList);//打印为null
求教这是为什么,orderList是一个对象数组,orderShopList最终不是应该有数值吗?