I am running the Node.js + MongDB exercice proposed at https://www.w3schools.com/nodejs/nodejs_mongodb_join.asp
There are two collections, orders and products. After the aggregate, the expected result should be:
[
{ _id: 1, product_id: 154, status: 1, orderdetails: [
{ _id: 154, name: 'Chocolate Heaven' } ]
}
]
However, in my local instance, I am getting the following result:
[ { _id: 1, product_id: 154, status: 1, orderdetails: [ [Object] ] } ]
What shoud I do in order to get an { _id: 154, name: 'Chocolate Heaven'} instead of an [Object]?