Hello, I am just wondering how Meteor handles CSV data?
So for example I have a CSV file that is delivered to my server daily and I’d like to import this data into MongoDB.
Is there an easy way of importing data into MongoDB with Meteor? Or will I have to find another way with PHP or something to do this?
Thanks, Nick
Sanjo
November 6, 2015, 3:24pm
2
Go to https://www.npmjs.com/ and find a CSV parser package
Use the npm package to convert the CSV data to an array of objects
Iterate through the array and insert the objects into MongoDB
If it is unclear how to do step 2 and 3, just search for them. You will likely find an answer.
You can find meteor packes handling this stuff for you like a charm
Install them inside console with “meteor add” inside the root folder of the application
https://atmospherejs.com/?q=csv
I’ve had to deal with CSV import/export and I used https://atmospherejs.com/harrison/babyparse
aykut
November 7, 2015, 9:26am
5
Ryan Glover wrote a recipe about importing CSVs, I think you can find an answer there: https://themeteorchef.com/snippets/importing-csvs/