Tengo una API que me devuelve muchos objetos como este.
{ id : 1243, string: "things", bool: 1, date: "2021-21-11"} { id : 4233, string: "somethingselse", bool: 1, date: "2021-21-11"}Puedo tener muchos datos para el mismo ID que
{ id : 1243, string: "other", bool: 0, date: "2021-27-10"} { id : 4233, string: "somethings else again", bool: 1, date: "2021-21-11"}Así que hice una función para agrupar por id mis datos para obtener algo como
object = { 1243: [{ 0: { string: "things", bool: 1, date: "2021-21-11" }, 1: { string: "other", bool: 0, date: "2021-27-10" } }] object2 = { 4233: [{ 0: { string: "somethings else again", bool: 1, date: "2021-21-11" } }]pero ahora quiero algo como esto
alldata = [{ 1243: [{ "2021-21-11": { string: "things", bool: 1 }, "2021-27-10": { string: "other", bool: 0 } }], 4233: [{ "2021-21-11": { string: "somethings else again", bool: 1, } }] }]no sé cómo hacer esto, traté de generar matrices, objetos pero nada genial