For AI agents: a documentation index is available at https://www.mongodb.com/es/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
MongoDB Branding Shape
Click here >
Docs Menu

MongoDB\GridFS\Bucket Class

MongoDB\GridFS\Bucket

GridFS is a specification for storing and retrieving files in MongoDB. GridFS uses two collections to store files. One collection stores the file chunks (e.g. fs.chunks), and the other stores file metadata (e.g. fs.files). The MongoDB\GridFS\Bucket class provides an interface around these collections for working with the files as PHP Streams.

You can construct a GridFS bucket using the extension's Manager class, or select a bucket from the library's MongoDB\Database class via the selectGridFSBucket() method.

On this page