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
})curl -X POST https://api.briq.cloud/v1/briqs \
-H "Authorization: Bearer $BRIQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"recipe": "mongo",
"params": {
"version": "8",
"size": "small",
"diskGb": 2
},
"wait": true
}'
# → { "briqs": [{ "id": "bq_…", … }], "outputs": { "MONGODB_URI": "…" }, … }
# ... when done, for each briq id
curl -X DELETE https://api.briq.cloud/v1/briqs/<id> \
-H "Authorization: Bearer $BRIQ_API_KEY"Parameters
| Name | Type | Options | Default |
|---|---|---|---|
| version | enum | 7, 8 | "8" |
| size | enum | nano, small, medium, large | "small" |
| diskGb | number | — | 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
| Briq | Image | Ports | Size | Volume |
|---|---|---|---|---|
| mongo | mongo:8 | 27017 | small | 2 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_puta script to/seed.js, thenbriq_execwithsh -c 'mongosh -u root -p "$MONGO_INITDB_ROOT_PASSWORD" app /seed.js'. - Connect from outside:
briq_exposeport 27017 withprotocol: "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.