Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
Create a custom JSON

I'm not that pro at JSON I have some knowledge but I think not that deep knowledge and I want to create a custom JSON from an array of objects. I hope you can help me.

I'm using JavaScript and NodeJS....

So I have the next data coming from my backend (array of objects):

enter image description here

and I want to create a JSON like this:

{
"items":[
    {
        "name":"extintor de agua",
        "itemData":[
            {
                "caracteristica":"item 1", "header": "Header 1", "id":12867
            },
            {
                "caracteristica":"item 2", "header": "Header 1", "id":12870
            }
        ]
    },
    {
        "name":"Extintor CO2",
        "itemData":[
            {
                "caracteristica":"item 1", "header": "Header 1", "id":12873
            },...
        ]
    }
]

}

As you can see I retrieve multiple rows for the same Entity field for example: multiple rows for "extintor the agua" and multiple rows for "extintor CO2" and so on with many more items. In the JSON you can see that I'm assigning the Entity field one time as "name" and inside that a "item Data" that contains all the values from the multiple "extintor de agua" values.

can I do that with JSON? if so how can I do it. If the problem needs more explanation I can give it I hope you can help me :)

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda