Database

[{"created_at":"Date","size_chart":[{"Inventory":-1,"Name":"L","Waist":32,"Hips":42},{"Inventory":-1,"Name":"L","Waist":32,"Hips":42},{"Inventory":1,"Name":"XL","Waist":32,"Hips":42},{"Inventory":3,"Name":"M","Waist":32,"Hips":42},],"status":"active","original_price":300.0}]

Query

db.collection.aggregate([{"$match":{"size_chart.Inventory":{"$gt":0}}},{"$project":{"Names":"$size_chart.Name"}},{$unwind:"$Names"},{"$group":{"_id":"$_id","NamesSet":{"$addToSet":"$Names"}}}])

Result