If I have an array structured like this:
[0]:
["id_1"]:
prop1: "abc"
prop2: "def"
["id_2"]:
prop1: "ghi"
prop2: "jkl"
[1]:
["id_3"]:
prop1: "mno"
prop2: "pqr"
["id_4"]:
prop1: "stu"
prop2: "vwx"
Is there a way to transform it into an array with the format below?
[0]:
key: "id_1"
prop1: "abc"
prop2: "def"
[1]:
key: "id_2"
prop1: "ghi"
prop2: "jkl"
[2]:
key: "id_3"
prop1: "mno"
prop2: "pqr"
[4]:
key: "id_4"
prop1: "stu"
prop2: "vwx"
I attempted to use flatten functions referenced in this link, but I'm unsure of how to assign the correct keys to each flattened child element.