Running MongoDB in Docker with prorm

Read this page in the documentation

Running MongoDB in Docker with prorm prorm reaches MongoDB through MongoStore, the document implementation of the minimal NoSqlStore interface (src/nosql/store.ts). It is not a SQL Dialect — there is no query(sql), no DDL and no identifier quoting. It implements the lifecycle (connect / disconnect / isConnected / getClient) and exposes MongoDB's real API shape: filters, projections, aggregation pipelines and typed collections. Start the container For a replica set (needed for transactions and change streams): Waiting for readiness Dependencies The mongodb driver is a peer of the store — prorm does not bundle it. Connect and use the store getClient() returns the underlying MongoClient when you need something the store does not wrap — change streams, GridFS, explicit sessions. Data persistence docker run without a volume keeps data inside the container's writable layer, so it disappears with docker rm. Mount a volume to keep it: Tear down Troubleshooting Symptom | Cause | --- | --- | MongoServerSelectionError after 30 s | Nothing is listening — the container is still starting, or 27017 is not published. | Transaction numbers are only allowed on a replica set | Transactions need --replSet plus rs.initiate(). | Data gone after a restart | No volume mounted. | MongoNotConnectedError | connect() was not awaited before the first operation. | Related reading NoSQL stores overview — the full store index mongodb — the store's own API notes, in the repository