#cqrs #mongo-db #cqrs-es #event-sourcing

mongo-es

A MongoDB implementation of the cqrs-es event store

4 releases (2 breaking)

0.3.0 Aug 20, 2025
0.2.1 Aug 20, 2025
0.2.0 Aug 18, 2025
0.1.0 Jul 29, 2025

#1643 in Database interfaces

Download history 99/week @ 2025-07-27 12/week @ 2025-08-03 356/week @ 2025-08-17 93/week @ 2025-08-24 62/week @ 2025-08-31 4/week @ 2025-09-07

515 downloads per month

Apache-2.0

43KB
1K SLoC

mongo-es

Crates.io Version codecov

A MongoDB implementation of the PersistedEventRepository trait in cqrs-es.


Usage

Add the following to your Cargo.toml:

[dependencies]
cqrs-es = "0.4.12"
mongo-es = "0.3.0"

Development

All unit tests run against a local MongoDB instance which can be started using the provided compose.yaml file. A default "standalone" MongoDB instance does not support transactions, so a single-node replica set is configured.

[!NOTE] Unit tests need to be run serially due to a single shared MongoDB instance for all tests. If tests are executed in parallel, assertions can happen concurrently and produce flaky results. Serial execution can be achieved by running the tests with nextest or by adding a simple option to cargo test as described below.

docker compose up -d

cargo nextest run
# or
cargo test -- --test-threads=1

Dependencies

~12–23MB
~318K SLoC