May 2018
Intermediate to advanced
470 pages
13h 54m
English
In previous chapters, we discussed how files uploaded by users could be stored directly in MongoDB as binary data. But this only worked for files smaller than 16 MB. In order to store larger files in MongoDB, we will need to use GridFS.
GridFS stores large files in MongoDB by dividing the file into several chunks of a maximum of 255 KB each, and then storing each chunk as a separate document. When the file has to be retrieved in response to a query to GridFS, the chunks are reassembled as needed. This opens up the option to fetch and load only parts of the file as required, rather than retrieving the whole file.
In the case of storing and retrieving video files for MERN Mediastream, we will utilize GridFS ...
Read now
Unlock full access