I need to get all the distinct name of color inside the content from the document whose name is "color",
Match criteria to get distinct content.values.name where content.name = color.
The Expected result:
[red, green, blue,tomato, sky, darkblue]
The example Documents:
[
{
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" }
]
}
]
},
]