How to take backup and restore db:
-----------------------------------
1. Installing the Database Tools (mongodb >= 4) from below url
https://www.mongodb.com/try/download/database-tools?tck=docs_databasetools
2. follow instructions from below url:
https://docs.mongodb.com/database-tools/installation/installation/
3. Set environmental path with below steps:
a) Open the Control Panel.
b) In the System and Security category, click System.
c) Click Advanced system settings. The System Properties modal displays.
d) Click Environment Variables.
e) In the System variables section, select Path and click Edit. The Edit environment variable modal displays.
f) Click New and add the filepath to the location where you copied the Database Tools.
g) Click OK to confirm your changes. On each other modal, click OK to confirm your changes.
4. Once set, you can run any of the Database Tools directly from your command prompt.
a) mongodump => mongodump --db=<DB_NAME> --out=<DESTINATION_PATH_TO_SAVE>
Example:mongodump =>
mongodump --db=vel_mongo --out=E:\xampp\htdocs\node\Node-mongo-api\vel_mongo
mongodump --host=mongodb1.example.net --port=3017 --username=user --password="pass" --out=/opt/backup/mongodump-2013-10-24
b) Restore =>
mongorestore --db masterdb E:\xampp\htdocs\node\Node-mongo-api\db_backup\masterdb