MongoDB
Turn every insert, update, replace and delete in MongoDB into a typed event in Tessel. Use it to start workflows, run aggregations and write results back to your collections.
Database
Category
CDC
Sync mode
p95 350 ms
Latency
6 min
Setup time
What it can do
- Document insertedCDC
- Document updatedCDC
- Document replacedCDC
- Document deletedCDC
- Find documentsRead
- Run an aggregationRead
- Insert a documentWrite
- Update documentsWrite
- Upsert by filterWrite
Overview
The MongoDB connector opens a change stream on the collections you choose, so workflows react to writes as they commit. Each change arrives as a typed event with the full document attached, and every event shows up in the trace of the run it started.
Teams use it to refund a Stripe charge when an order document is cancelled, to open a Zendesk ticket when a device reports an error and to forward product events to Kafka for the data team.
Supported versions
MongoDB 5.0 to 8.0, as a replica set or sharded cluster
MongoDB Atlas dedicated clusters and self-managed deployments
Connections over TLS with SCRAM or X.509, plus Atlas private endpoints
How change streams work
Tessel watches the database with a filter for your collections and asks for the current document on updates. Each event carries a resume token. Tessel stores the token after every delivery, so after a restart it resumes from the next change instead of starting over.
Resume window
A resume token is only valid while its change is still in the oplog. Size the oplog for at least 24 hours of writes, or set a minimum retention period on Atlas. If a token has aged out, Tessel takes a fresh snapshot and notes it in the trace.
Permissions needed
Create a database user for Tessel with a custom role. It needs the changeStream action and read access on the watched collections. Write actions are only required if a workflow inserts or updates documents.
changeStreamandfindon each watched collectionThe built-in
readrole works for a quick startinsertandupdateonly on collections you write back to
Five steps. About six minutes.
Most of the time goes into the custom role. Tessel opens a test change stream before you pick collections.
- Create a database user with a custom read roleMongoDB2 min
- Add Tessel's static IPs to the access listNetwork1 min
- Paste the SRV connection string and pick collectionsTessel2 min
- Choose whether to snapshot existing documentsTessel1 min
- Insert a test document and watch the event arriveVerify350 ms
Your collections, in a workflow today.
Connect MongoDB on the free plan. Up to three builders and 10,000 runs a month, no card required.