I'm attempting to join an array of objects with the "same" keys as one array. Basically the what I mean by "same keys" is that these keys will vary in only on number, in which doesn't matter. For example:
{ names.0.id: "Here" }
{ names.1.id: "Almost" }
{ names.2.id: "There" }
...
I wan't to join all the keys that have the following syntax into one. Like:
{ names: ["Here", "Almost", "There"] }
I have a array of arrays containing this data.
[{
"id": "123"
}, {
"group_name": "Test Group"
}, {
"admin": "Somthing"
}, {
"email_address": "[email protected]"
}, {
"org.id": "4"
}, {
"created_by": "6"
}, {
"updated_by": "6"
}, {
"students.0.id": "Yes"
}, {
"students.1.id": "No"
}, {
"names.0.id": "Here"
}, {
"names.1.id": "Almost"
}, {
"names.2.id": "There"
}],
[{
"id": "125"
}...
]
...
What I would like to accomplish:
[{
"id": "123"
}, {
"group_name": "Test Group"
}, {
"admin": "Somthing"
}, {
"email_address": "[email protected]"
}, {
"org.id": "4"
}, {
"created_by": "6"
}, {
"updated_by": "6"
}, {
"students": ["Yes", "No"]
}, {
"names": ["Here", "Almost", "There"]
}]
For any other keys that have this syntax of:
name.number.id
I would always like to join in a single array with the first part of the name