I need to read a large JSON file (around 630MB) in Nodejs and insert each object to MongoDB.
I've read the answer here:Parse large JSON file in Nodejs.
However, answers there are handling the JSON file line by line, instead of handling it object by object. Thus, I still don't know how to get an object from this file and operate it.
I have about 100,000 this kind of objects in my JSON file.
Data Format:
[
{
"id": "0000000",
"name": "Donna Blak",
"livingSuburb": "Tingalpa",
"age": 53,
"nearestHospital": "Royal Children's Hospital",
"treatments": {
"19890803": {
"medicine": "Stomach flu B",
"disease": "Stomach flu"
},
"19740112": {
"medicine": "Progeria C",
"disease": "Progeria"
},
"19830206": {
"medicine": "Poliomyelitis B",
"disease": "Poliomyelitis"
}
},
"class": "patient"
},
...
]
Cheers,
Alex
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…