I am looking for a way to convert a JSONL file to JSON.
I have written a python program but at some point it's just getting to slow because the JSON file gets to big. And with every loop I checked if the keys are in there…
Maybe some of you has an idea on how to write a program that does the following:
The JSONL file is from a Firebase export, which looks like this:
{"__path__":"cars/89dHLbXAOooudSNHv6Jt","__exportPath__":"","__id__":"89dHLbXAOooudSNHv6Jt","brandId":"Fp5Kwr7NXNRPxY7Yx3QK","name":"Testuser", "email": "test.user@email.com", "settings":{"test1":true,"test2":true}}
The document can also have subcollections:
{"__path__":"cars/89dHLbXAOooudSNHv6Jt/subcollection/dwadwadawdwaddwa","__exportPath__":"","__id__":"dwadwadawdwaddwa","modelId":"d54321242","name":"testcar", "motor": "example f1"
this needs to be converted into this:
{
"cars": {
"89dHLbXAOooudSNHv6Jt": {
"brandId": "Fp5Kwr7NXNRPxY7Yx3QK",
"name": "Testcar",
"email": "test.user@email.com",
"settings": {
"test1": true,
"test2": true
},
"subcollection": {
"dwadwadawdwaddwa": {
"modelId": "d54321242",
"name": "testcar",
"motor": "example f1"
}
}
}
}
}