# Make sure that we have mongoD process running and file below command from bash and not from Mongo shell to export data. This will export data for one collection in Db, to export entire DB use mongo dump
MQ428GG8WL:week2 asee2278$ mongoexport –db students –collection grades –out gradesOut.json
- 2016-01-14T14:21:18.813-0600 connected to: localhost
- 2016-01-14T14:21:18.831-0600 exported 800 record
Sample exported record would look like :
{"_id":{"$oid":"50906d7fa3c412bb040eb583"},"score":92.6244233936537,"student_id":3,"type":"exam"}
Pingback: MongoDb Tutorial 6 – How to Import and Export data in Mongo DB | Coding Review