take backup of mongo data code example
Example 1: take db backup mongodb
mongodump --collection=myCollection --db=test
Example 2: take db backup mongodb
mongodump --out=/data/backup/
mongodump --collection=myCollection --db=test
mongodump --out=/data/backup/