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:
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 = ""
}