I have below documents
1.
client::c1
{
“type”: “client”,
“versions”: [
“1.0”,
“1.1”,
“1.2”
]
}
client::c2
{
“type”: “client”,
“versions”: [
“1.0”
]
}
3.{
“type”: “version”,
“versions”: [
{
“major”: “1.0”,
“minor”: [
“1.0.1”,
“1.0.2”
]
},
{
“major”: “1.1”,
“minor”: [
“1.1.1”,
“1.1.2”
]
},
{
“major”: “1.3”,
“minor”: []
}
]
}
Expected output as below
[
{
“clientName”: “c1”,
“versions”: [
{
“type”: “major”,
“versionName”: “1.0”
},
{
“type”: “minor”,
“versionName”: “1.0.1”
},
{
“type”: “minor”,
“versionName”: “1.0.2”
},
{
“type”: “major”,
“versionName”: “1.1”
},
{
“type”: “minor”,
“versionName”: “1.1.1”
},
{
“type”: “major”,
“versionName”: “1.2”
}
]
},
{
“clientName”: “c2”,
“versions”: [
{
“type”: “major”,
“versionName”: “1.0”
}
]
}
]