Month: May 2015

Port data from Mongodb to Excel type

Hi, We had to port data from mongodb to excel for making it easily accessible across our team. If you are facing similar problem, below inbuilt methods of mongodb can be used to do that-

First Export your collection data into CSV file

mongoexport –db SampleDatabase –collection SampleCollection –csv –fields name,address,category,area –out SampleData.csv

Now upload your file to google drive and open it with google sheets, this automatically creates a new google sheet in your drive. Share it with your team!

I’m not sure but mostly you should be able to directly import into excel sheet to instead of google drive.

Just incase if you need to export it to json, same method can be used but you need to remove “–csv” option

mongoexport –db SampleDatabase –collection SampleCollection –out SampleData.json

Advertisements