DEV Community

Radhakishan Jangid
Radhakishan Jangid

Posted on

Mongodump and Mongorestore

Use following command to generate archive of mongodb dump database.

mongodump --db <database_name> --gzip --archive=./dump
Enter fullscreen mode Exit fullscreen mode

Use following command to generate json of mongodb dump database.

mongodump -d <database_name -o ./dump 
Enter fullscreen mode Exit fullscreen mode

Use following command to import archive of mongodb dump into database.

mongorestore --gzip --archive=./dump
Enter fullscreen mode Exit fullscreen mode

Hope it helps you.
😊

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs