My JSON object looks like following:
{
"array1": [
{
"key1": "value1", // common key
"key2": "value2",
"key3": "value3"
},
{
"key1": "value1", // common key
"key2": "value2",
"key3": "value3"
}
],
"includes": {
"array2": [
{
"key4": "value1", // common key
"key5": "value5"
},
{
"key4": "value1", // common key
"key5": "value5"
}
]
}
}
I need to have the output in following format -
[
{
"key1": "value1",
"key2": "value2",
"key3": "value3",
"key5": "value5" // this comes from joining with array 2 based on key1 & key4
},
{
"key1": "value1",
"key2": "value2",
"key3": "value3",
"key5": "value5" // this comes from joining with array 2 based on key1 & key4
}
]