C100DBA practice question 5 of 25

Which mongodb tools allow us to work with our data in a human readable format?

Full set: 130 questions
Answer options
A: mongodump
B: mongostat
C: mongoimport Correct answer
D: mongoexport Correct answer
Correct Answer:
C. mongoimport; D. mongoexport
Explanation

The mongoexport tool exports data from a MongoDB collection into a human-readable format like JSON or CSV. The mongoimport tool imports data from human-readable formats (JSON, CSV, TSV) into a collection. Both tools, therefore, allow a user to work with data in a human-readable text format, either for extraction or for ingestion. mongodump creates a binary BSON file, which is not human-readable. mongostat displays performance statistics, not collection data.

Why Incorrect

A. mongodump creates a binary (BSON) backup of data, which is not directly human-readable and is intended for machine processing and restoration via mongorestore.
B. mongostat is a diagnostic tool that provides a real-time view of database server statistics and performance metrics, not the data itself.

References

1. MongoDB Manual, mongoexport, "Output Formats". The documentation states, "mongoexport can export data in either comma-separated values (CSV) or JavaScript Object Notation (JSON) formats." (https://www.mongodb.com/docs/database-tools/mongoexport/#output-formats)

2. MongoDB Manual, mongoimport, "mongoimport". The documentation specifies it "imports content from an Extended JSON, CSV, or TSV file". (https://www.mongodb.com/docs/database-tools/mongoimport/)

3. MongoDB Manual, mongodump, "Behavior". It states, "mongodump reads data from a MongoDB database and creates high-performance BSON files." (https://www.mongodb.com/docs/database-tools/mongodump/#behavior)

Scroll to Top