How it works...
The bsondump utility is a handy tool bundled with all MongoDB packages. It is very useful to parse the binary BSON files and output them in human readable format. In step 1, we begin by taking a backup of the mockdata collection. As expected, in step 2, we can see that the collection's data was dumped into two files, namely, mockdata.bson.gz and mockdata.metadata.json.gz. The former contains the actual data in BSON format while the latter contains metadata (index information) of the collection.
At this stage, I would like to point out two limitations of the bsondump tool. First, it cannot read a compressed file, not even .gzip. Second, it cannot read a mongodump archive either. It can literally only read raw BSON files. So, ...
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