take backup of database mongodb from mongoshell command 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/