Complete the code to create a backup of a MongoDB database using mongodump.
mongodump --db [1] --out /backup/mongodumpThe --db option specifies the database to back up. Here, mydatabase is the database name.
Complete the command to restore a MongoDB database from a backup folder using mongorestore.
mongorestore --db [1] /backup/mongodump/mydatabaseThe --db option specifies the target database name to restore into. It should match the original database name.
Fix the error in the command to back up only the 'users' collection from 'mydatabase'.
mongodump --db mydatabase --collection [1] --out /backup/users_backupThe collection name must exactly match the collection you want to back up. Here, the collection is named 'users'.
Fill both blanks to create a backup of the 'orders' collection from 'shopdb' and compress the output.
mongodump --db [1] --collection [2] --archive=/backup/orders.archive --gzip
The --db option specifies the database name, and --collection specifies the collection name to back up. Here, 'shopdb' and 'orders' are correct.
Fill all three blanks to restore the 'products' collection into 'inventorydb' from a compressed archive.
mongorestore --db [1] --collection [2] --archive=[3] --gzip
The --db option is the target database, --collection is the collection to restore, and --archive points to the backup file. The --gzip option tells MongoDB the archive is compressed.