Skip to main content
GridFS keeps files inside MongoDB: names and sizes in <bucket>.files, content in chunks in <bucket>.chunks. Slash-separated file names become folders.

Setup

Get a MongoDB connection URI as for the MongoDB VFS, for a user with readWrite on the database that holds the bucket (read for a read mount). In Atlas, the built-in Read and write to any database role also works. Then export it:
Python needs pip install "mirage-ai[gridfs]"; Node needs the mongodb peer dependency (pnpm add @struktoai/mirage-node mongodb).

Connect

workspace.yaml

Layout

  • The bucket is fs unless bucket names another; key_prefix scopes the mount to the files under that prefix.
  • A write adds a revision and the newest one is read. rm moves every revision to a trash no mount path reaches; keep_revisions bounds how many are kept.
  • mkdir stores a zero-byte data/ marker so an empty folder stays visible.

Sample runs

Every command that writes works on a write mount; mv renames every revision on the server.

SDK guides

Python

Every config field, the VFS.md and write support.

TypeScript

Every config field, the VFS.md and write support.