Did you know that when accessing files from GridFS these are streamed without being loaded entirely in memory?
GridFS splits a file into small chunks storing them in a special
chunks collection. Each file has additional metadata: filename, content type, and custom meta stored in a
GridFS permits range operations, thus one could retrieve only specific ranges of bytes from the file. (nb: I couldn’t find the API for this operation though, so maybe this is not exposed as API in the drivers).
Official GridFS documentation: