Database
[{content:[{name:"color",values:[{name:"red"},{name:"green"},{name:"blue"}]},{name:"extra",values:[{name:"A"},{name:"B"},{name:"C"}]}]},{content:[{name:"color",values:[{name:"tomato"},{name:"sky"},{name:"darkblue"}]},{name:"extra",values:[{name:"AA"},{name:"AB"},{name:"AC"}]}]},]
Query
db.collection.aggregate([{$match:{"content.name":"color"}},{$unwind:"$content"},{$match:{"content.name":"color"}},{$unwind:"$content.values"},{$group:{_id:null,values:{$addToSet:"$content.values.name"}}}])