/

MongoDB

Database connector

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.

Connect MongoDB
Connect MongoDB
See setup steps
See setup steps

Database

Category

CDC

Sync mode

p95 350 ms

Latency

6 min

Setup time

What it can do

Triggers · 4
  • Document insertedCDC
  • Document updatedCDC
  • Document replacedCDC
  • Document deletedCDC
Actions · 5
  • 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.

db.watch(
  [{ $match: { "ns.coll": { $in: ["orders", "customers"] } } }],
  { fullDocument: "updateLookup" }
)
db.watch(
  [{ $match: { "ns.coll": { $in: ["orders", "customers"] } } }],
  { fullDocument: "updateLookup" }
)
db.watch(
  [{ $match: { "ns.coll": { $in: ["orders", "customers"] } } }],
  { fullDocument: "updateLookup" }
)

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.

  • changeStream and find on each watched collection

  • The built-in read role works for a quick start

  • insert and update only on collections you write back to

Setup

Five steps. About six minutes.

Most of the time goes into the custom role. Tessel opens a test change stream before you pick collections.

  1. Create a database user with a custom read roleMongoDB2 min
  2. Add Tessel's static IPs to the access listNetwork1 min
  3. Paste the SRV connection string and pick collectionsTessel2 min
  4. Choose whether to snapshot existing documentsTessel1 min
  5. 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.

Connect MongoDB
Connect MongoDB
All integrations
All integrations

One email a month. Only what shipped.

A1

Product

C1

Layouts

D1

Company

E1

Template

F1

All systems operational
fra41 ms
iad38 ms
sin52 ms

C2

Elsewhere

XLinkedInGitHubYouTube

E2

Move across the wordmark168 blocks · iso 30°

One email a month. Only what shipped.

A1

Product

C1

Layouts

D1

Company

E1

Template

F1

All systems operational
fra41 ms
iad38 ms
sin52 ms

C2

Elsewhere

XLinkedInGitHubYouTube

E2

Move across the wordmark168 blocks · iso 30°

One email a month. Only what shipped.

A1

Product

C1

Layouts

D1

Company

E1

Template

F1

All systems operational
fra41 ms
iad38 ms
sin52 ms

C2

Elsewhere

XLinkedInGitHubYouTube

E2

Move across the wordmark168 blocks · iso 30°

Create a free website with Framer, the website builder loved by startups, designers and agencies.