All three Studio 3T editions support GridFS, the method MongoDB uses to store files larger than the document size limit of 16 MB.
MongoDB and GridFS
GridFS is the file abstraction method MongoDB uses to store and retrieve files larger than 16 MB.
GridFS divides large files into equal chunks with a default size of 255 kB and stores them as a separate document. The last chunk, however, can be as large as necessary.
MongoDB creates two collections to store the files. The first collection –
chunks – contains the file chunks; the second –
files – contains the file metadata. When you search GridDS for a file, the driver will reassemble the chunks as needed.
GridFS is a fitting mechanism to store files in MongoDB, which complements the schema-less (hence faster) retrieval of information provided by the document model.
Because files are divided into smaller chunks, it’s easier to access specific sections of a file, sparing the memory-expensive task of loading an entire file.
GridFS Support in Studio 3T
In Studio 3T, each database has a corresponding GridFS Buckets folder.
Within this folder is a default bucket called Images, but you can add more buckets as needed.
Add a new GridFS bucket
- Right-click on the GridFS Buckets folder.
- Choose Add Bucket.
- Name your bucket.
- Click OK.
Drop a GridFS bucket
- Right-click on the bucket to be deleted.
- Choose Drop Bucket.
Open GridFS view
Choose the bucket to view and press Enter.
Add a new file
Delete a file
⌫ (fn + ⌫ on Mac)
Save a file
Ctrl + S (⌘ + S)
View a file
F3 (fn + F3 on Mac)
Search for files
1. Define the search parameter in the drop-down. Choose from:
- File search
- ID search
- Type search
- Uploaded before
- Uploaded after
- File size smaller
- File size larger
- MD5 search
2. Type in the value to look for in the search bar.
3. Define the sort parameter. Choose from:
- No sort
- File Name
- File ID
- File Type
- Upload Date
4. Click on the Play button to run the search.
View the GridFS collections
Each GridFS bucket creates two corresponding collections: BucketName.chunks and BucketName.files.
BucketName.chunks contains the actual file chunks:
While BucketName.files contains the file metadata like filename, uploadDate, and contentType: