How it works...
The mongodump utility primarily connects to the mongod or mongos instance and dumps all data (except the local database) in BSON format.
In step 1, we create a common directory to store our backups and in step 2, we switch to that directory and execute the mongodump utility without any parameters.
By default, if no parameters are specified to the utility, mongodump creates a directory called dump in the current working directory. Additionally, for every database on the server, it creates a subdirectory with the name of the database and, within this subdirectory, it creates a BSON file for every collection within the database. We can observe this by inspecting the directories, as shown in step 3.
In addition to BSON files, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access