Implementing a GridFS Store
Occasionally you might want to use MongoDB to store and retrieve data that exceeds the 16MB size limit (for example, if you are storing large images, zip files, movies, etc.). To accommodate this, MongoDB provides the GridFS framework. GridFS splits large documents into chunks. The chunks are stored in one collection, and metadata that is used to access the documents is stored in another collection.
When you query GridFS for a document, the chunks are reassembled and sent back just as any other document. A great feature of GridFS is that by using skip, you can read from the middle of a document without needing to load the entire document from disk. This allows you to read chunks of large files without running the ...
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