I have this data:
> db.Category.find().pretty()
{
"_id" : ObjectId("542450a928db034349fb3bf2"),
"name" : "A category",
"products" : [
{
"_id" : ObjectId("542450a928db034349fb3bf3"),
"name" : "Producto de categoria",
"price" : 11.11
}
]
}
When I run db.Category.find( {}, {products:1} )
I get this:
{ "_id" : ObjectId("542450a928db034349fb3bf2"), "products" : [ { "_id" : ObjectId("542450a928db034349fb3bf3"), "name" : "Producto de categoria", "price" : 11.11 } ] }
I get the data about one product, but how can I get the data about all products?