nerdexam
MongoDB

C100DBA · Question #126

What tool would you use if you want to save a gif file in mongo? Answer: mongofile

The correct answer is A. mongofile. mongofiles (option A) is the correct tool because it provides a command-line interface to MongoDB's GridFS storage system, which is specifically designed for storing binary files - such as GIFs, images, and videos - that may exceed MongoDB's 16MB BSON document size limit…

MongoDB Fundamentals

Question

What tool would you use if you want to save a gif file in mongo? Answer: mongofile

Options

  • Amongofile

How the community answered

(58 responses)
  • A
    100% (58)

Explanation

mongofiles (option A) is the correct tool because it provides a command-line interface to MongoDB's GridFS storage system, which is specifically designed for storing binary files - such as GIFs, images, and videos - that may exceed MongoDB's 16MB BSON document size limit. GridFS splits large files into chunks and stores them across two collections (fs.files and fs.chunks), and mongofiles is the dedicated utility to put, get, list, and delete those files.

Since this question has only one choice, there are no distractors to eliminate - but worth noting: general MongoDB tools like mongodump, mongorestore, or mongosh are not designed for binary file I/O into GridFS, which is why a dedicated tool exists.

Memory tip: Think of mongofiles as MongoDB's version of a file cabinet - just as you'd use a special cabinet for physical documents rather than a regular desk drawer, you use mongofiles (not general mongo tools) whenever you're dealing with actual files like GIFs.

Topics

#mongofiles#GridFS#binary storage#tools

Community Discussion

No community discussion yet for this question.

Full C100DBA Practice