query mongo to find the count of all cars array in each document of collection company
I am new to mongo, I
db.company.find() --> but then how do I select the arrays and that too for all of them
collection company : {
{
"_id": "5b8ed214b460e7c17c5a33f9",
"company_location": "USA",
"company_name": "gmc",
"__v": 0,
"cars": [{
"_id": "5b8ed214044b2509466eca2e",
"model": "TERRAIN",
"year": 2013,
"PriceInINR": 3851710,
"trim": "SLE2 FWD",
"engine": "SPORT UTILITY 4-DR",
"body": "2.4L L4 DOHC 16V FFV",
"color": "Yellow",
"transmission_type": "Manual",
"dealer_id": "5b8e7ce7065fa50bee095072"
},
{------},
{------}
}