U kunt select
. gebruiken functie en vul dan als volgt in
Order.findOne({ _id: req.body.id})
.select('-_id productOrder')
.populate('productOrder')
.exec(function (err, orderObj) {
if(!err) {
var productOrder = orderObj.productOrder;
//products.forEach(function(elem){
console.log("products = " + JSON.stringify(productOrder));
//});
console.log("REQ._ID " + req.body.id);
res.render('store/cart', {
title: 'MyCart',
angularApp: 'storeApp',
products: productOrder
});
}
});