Hi I have a set CSV files that I need to import into mongo DB.
my data is already tidy, I want to untidy it to create json object I can import.
For example:
client, receipt, total
1 101 $10
1 102 $11
2 201 $10
I woudl like to create list of json strings like:
list:
[1]
{
"client":1,
"receipts":[
{
"receipt":101,
"charge":10
},
{
"receipt":102,
"charge":11
}
]
}
[2]
{
"client":2,
"receipts":[
{
"receipt":201,
"charge":10
}
]
}
This was supposed to be a simple problem but it looks that all google results are talking about getting json into a tidy data.frame instead.