I am trying to query a mongodb list in a single document. As shown below, I would like to match the code and get wheels value. if code = car then query should return wheels and allowed value for that list element. Below is a list from single document.
"vehicles" : [
{
"code" : "car",
"wheels":4,
"allowed": True
},
{
"code" : "Tuk Tuk",
"wheels":4
"allowed":True
},
{
"code" : "Bike",
"wheels":4
"allowed":False
}]