How to convert an array of «many to many» no duplicate entries? We need all possible matches between arrays. Keep in mind that data can be repeated, so duplication of records should be avoided.
My data:
[
{
"id": [
"stackoverflow"
],
"hello": [
"hello1",
"hello2"
],
"world": [
"world1",
"world2"
]
}, {
"id": [
"stackexchange"
],
"my": [
"my1"
],
"world": [
"world1",
"world3"
]
}, {
"id": [
"stackoverflow"
],
"hello": [
"hello1"
],
"world": [
"world1"
]
}
]
Need result all array elements:
[
{
"id": "stackoverflow",
"hello": "hello1",
"world": "world1"
}, {
"id": "stackoverflow",
"hello": "hello1",
"world": "world2"
}, {
"id": "stackoverflow",
"hello": "hello2",
"world": "world1"
}, {
"id": "stackoverflow",
"hello": "hello2",
"world": "world2"
}, {
"id": "stackexchange",
"my": "my1",
"world": "world1"
}, {
"id": "stackexchange",
"my": "my1",
"world": "world3"
}
]
Thank you for your responses.