Follow this link for installation steps.
mongoexport --uri="mongodb://127.0.0.1:27017/dbName" --jsonFormat=canonical --collection=textcontent --out=textcontent.jsonmongoexport --uri="mongodb://127.0.0.1:27017/dbName" --collection=textcontent --type=csv --fields=name,address --out=/backups/collection.csvHere mode can be any one from insert, upsert, merge & delete see this for details
mongoimport --uri="mongodb://127.0.0.1:27017/dbName" --collection=textcontent --type=json --mode=upsert --file=./textcontent.jsonHere remove db name from URI to export all databases.
mongodump --uri="mongodb://127.0.0.1:27017/dbName" --out=./2023-06-09Here --dir specifies dump dir location for restore & command will automatically pick database name from dump dir.
mongorestore --uri="mongodb://127.0.0.1:27017" --dir=./2023-06-09