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

162
Visualizações
Is there a way to save an appended JSON object in JavaScript?

I have a large json file with ~45,000 objects and 15 million keys that I've managed to append with JavaScript. I'm able to log out the new, desired json object but only for about 600 of the 45,000 objects. Is it possible to save the updated object to a file?

I'm looking to either:

  1. Overwrite the original file with the new content.
  2. Save the updated object to new file.
  3. Use any alternative option that will let me work with the output of this code in its entirety.

I'm very new so just getting to this point was a massive feat. I'd apprecitate any guidance and insight you have to offer.

Here is my code:

var data = require('./BC_Data.json');
var y = data.features.map((property) => property.properties.GAZETTED_NAME)

var language = {
    waterbody: ""
}

for (var i=0; i < y.length; i++) {
var input = data.features[i].properties.GAZETTED_NAME;

    if (input != null) {
    var sentence = input.toLowerCase().split(" ");
    for (var x=0; x < sentence.length; x++) {
        sentence[x] = sentence[x][0].toUpperCase() + sentence[x].slice(1)
    } 
    language.waterbody = sentence.join(" ")
    var obj = Object.assign(data.features[i], language)
    console.log(obj) // Desired Output to be saved
    } else 
    language.waterbody = ""
}
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