I want to extract value from array. right now i have
db.getCollection('typeE').distinct("list.name",{"list.name":"C"})
I have such structure
object(1)"list":[{"name":"A","value":10},{"name":"B","value":20},{"name":"C","value":50}]
object(2)"list":[{"name":"D","value":100},{"name":"E","value":70}]
I want to receive 50 , but right now receive only object(1)
I also tried
db.getCollection('typeE').distinct("list.value",{"list": {$elemMatch: {"name":"C"}}})
but it's return array