Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Download mongoDB data as csv file

    • 0
    • 2
    • 1
    • 1
    • 0
    • 0
    • 0
    • 0
    • 610
    Comment on it

    Want to export MongoDB collection data to a csv file use mongoexport utility that produces data in JSON or CSV format.

    Use the following command to export data:

    mongoexport --host <hostName> --db <databaseName> --collection <collectionName> --csv --out nameOfFile.csv --fields Field1,Field2,Field3
    

    Options:

    • --host: Url of mongoDB
    • --db: Name of Database
    • --collection: Name of the Collection (Table)
    • --csv: Download file in comma separated values (CSV) format. The default format is JSON.
    • --out: Specify a file to write the export to

    For example:

    mongoexport --host localhost --db posts --collection blog --out dbFile.csv
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: