I have 3 separate documents as below
Doc one:
{
"type":"android"
"Data":{
"key1":"value1",
"key2":"value2"
}
}
Doc 2:
{
"type":"ios"
"Data":{
"key1":"value3",
"key2":"value4"
}
}
{
"type": "key-meta-data",
"keyMetaData": [{
"keyName": "key1",
"features": [
"CLI",
"Transection",
"Statements"
]
},
{
"keyName": "key2",
"features": [
"CLI",
"Transection",
"Statements",
"Reward"
]
}]
}
How to merge the records , my output should be
{"type": "key-meta-data",
"keyMetaData": [
{
"android":"value1" ,
"ios":"value3" ,
"keyName": "key1",
"features": [
"CLI",
"Transection",
"Statements"
]
},
{
"android":"value2" ,
"ios":"value4" ,
"keyName": "key2",
"features": [
"CLI",
"Transection",
"Statements",
"Reward"
]
}
]
}