From the course: Learning MongoDB

Unlock the full course today

Join today to access over 23,400 courses taught by industry experts.

How to use GridFS to store files

How to use GridFS to store files - MongoDB Tutorial

From the course: Learning MongoDB

How to use GridFS to store files

- [Instructor] You can not only store documents in MongoDB, you can store entire files. This opens up a lot of possibilities, not only for better organization but also application features. To do this, MongoDB uses what's called GridFS, a technology that will break up the contents of the file into chunks each stored in its own document and also store the information about the file itself in a sort of parent document. When you need the file back, MongoDB will simply stream the chunks back to you. A great way to get started with GridFS is to use the mongofiles binary that's included with the database tools. Refer to that video again if you haven't installed them already, or if you're using the codespace, it's already there for you. To illustrate how GridFS works, let's store some new files. First, we'll upload an image that we can use for one of our recipes. Inside of the lessons, 5.5 folder, you'll see there's an…

Contents