How to export data from mongoDB

# 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 :


One thought on “How to export data from mongoDB

  1. Pingback: MongoDb Tutorial 6 – How to Import and Export data in Mongo DB | Coding Review

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.