If I have a schema similar to the following:
{
"_id" : "12345",
"_class" : "Refrigerator",
"items" : {
"APPLE" : {
"id" : 123,
"name" : "APPLE"
},
"BANANA" : {
"id" : 234,
"name" : "BANANA"
},
"STRAWBERRY" : {
"id" : 345,
"name" : "STRAWBERRY"
}
},
},
{
"_id" : "23456",
"_class" : "Pantry",
"items" : {
"CEREAL" : {
"id" : 456,
"name" : "CEREAL"
}
},
}
I want to get a list of distinct items where the _class=Refrigerator. The result should be ["APPLE","BANANA","STRAWBERRY"].
How can I do this? Thank you!
{ "items": [ { "id": 123, "name": "APPLE" }, { "id": 234, "name": "BANANA" }, { "id": 345, "name": "STRAWBERRY" } ] }