Skip to content

Mongo change streams - #2884

Open
gedaiu wants to merge 3 commits into
vibe-d:masterfrom
gedaiu:mongo-change-streams
Open

Mongo change streams#2884
gedaiu wants to merge 3 commits into
vibe-d:masterfrom
gedaiu:mongo-change-streams

Conversation

@gedaiu

@gedaiu gedaiu commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Hey @s-ludwig! This builds on the sessions/transactions PR and adds change stream support to the MongoDB driver.

It introduces watch() at all three levels — on the client (a change stream over the whole deployment), on a database (all its collections), and on a single collection. The returned ChangeStream is an input range that tracks resume tokens and automatically resumes on transient or resumable server errors. As usual for change streams, it needs a replica set or a sharded cluster.

It's stacked on mongo-sessions-and-transactions, so please review that one first; the diff here is just the change-stream feature (one new module, the three watch() methods, and an integration test).

Builds clean and all unit tests pass.

Closes #2860
Merge after #2883

Thanks for taking a look!

gedaiu added 3 commits June 17, 2026 16:30
…nitoring, primary write-routing

Reworks the MongoDB driver onto a Server Discovery and Monitoring (SDAM) foundation: single-pass topology discovery, background health monitoring, writes routed to the primary, per-query read preferences, and read-preference tag server selection.

Adds the wire/codec and topology infrastructure (serverdescription, monitor, wire, wireversion, compression, commands, clustertime) and reworks connection/client/collection/database/cursor onto it.

Base of a stacked series: client sessions, multi-document transactions and retryable writes follow in the next PR, and the self-contained MongoDB 8 features (change streams, client bulkWrite, GridFS, CSFLE, Stable API, mongodb+srv, load-balancer mode) as PRs on top of that.

Closes vibe-d#2845, vibe-d#2847, vibe-d#2848, vibe-d#2849, vibe-d#2851
…writes

Adds client session support (logical session ids backed by a server session pool), multi-document transactions (start/commit/abort), and retryable writes — including write retry when the primary steps down — on top of the SDAM core.

Stacked on mongo-driver-core-improvements.

Closes vibe-d#2850, vibe-d#2854, vibe-d#2855, vibe-d#2856
Adds change streams via watch() on MongoClient (whole deployment), MongoDatabase (all collections), and MongoCollection. The returned ChangeStream input range tracks resume tokens and automatically resumes on transient/resumable errors; requires a replica set or sharded cluster.

Stacked on mongo-sessions-and-transactions.

Closes vibe-d#2860
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[vibe-d/mongodb] [feature] [mongo8] No change stream support

1 participant