Below is my schema:
[{
"attributes":[
{
"attrId":"123",
"values":[
{"name": "asd"},
{"name": "bcc"}
]
},
{
"attrId":"456",
"values":[
{"name": "zzz"},
{"name": "bcc"}
]
}
]
},
{
"attributes":[
{
"attrId":"123",
"values":[
{"name": "asd"},
{"name": "bcc"}
]
},
{
"attrId":"456",
"values":[
{"name": "kkk"},
{"name": "bcc"}
]
}
]
}]
I want output as:
[{123:["asd","ccc"]}]
i.e to return attrId and values if all values match with all other documents,
I am thinking it to convert values into string like "asdbcc" so that it will be easy to compare.