briqbriq

MongoDB

A MongoDB server with authentication and a persistent volume.

  • database
  • document

Guide: Connect to a database from outside

Run it

briq_run({
  recipe: "mongo",
  params: {
    "version": "8",
    "size": "small",
    "diskGb": 2
  },
  wait: true
})

Parameters

NameTypeOptionsDefault
versionenum7, 8"8"
sizeenumnano, small, medium, large"small"
diskGbnumber—2

Outputs

Returned by briq_run once the stack is healthy. Hosts resolve inside your team network; secrets are generated per run.

MONGODB_URI
mongodb://root:<MONGO_ROOT_PASSWORD>@mongo.<stack>.internal:27017/app?authSource=admin
MONGO_HOST
mongo.<stack>.internal
MONGO_USER
root
MONGO_PASSWORD
<MONGO_ROOT_PASSWORD>

What it runs

BriqImagePortsSizeVolume
mongomongo:827017small2 GB at /data/db

When to use it

  • Your code uses Mongoose, Prisma with MongoDB or the native driver, and needs the real server: indexes, aggregation, validation.
  • Tests expect MONGODB_URI.

Tips

  • Auth is on: the URI carries the generated root password and authSource=admin.
  • No transactions: it is a single node, not a replica set, so session.startTransaction() fails.
  • One database per suite when several run in parallel against the same briq.
  • Seed with mongosh: briq_files_put a script to /seed.js, then briq_exec with sh -c 'mongosh -u root -p "$MONGO_INITDB_ROOT_PASSWORD" app /seed.js'.
  • Connect from outside: briq_expose port 27017 with protocol: "mongodb", for mongosh or Compass. See Connect to a database from outside.
  • Bigger dataset? The volume starts small: pass diskGb, e.g. params: { diskGb: 20 }. Set it when the briq is created, and it counts toward your plan's disk.

On this page

Free to try

Let your agent try it, on us.

Every new account starts with €10 of credits. No card.

Connect your agent

How can we help?

Message to the briq team
hello@briq.cloud