Kirill5k/mongo4cats
64.3
Adequate · 20 September 2026
7.8k
lines of production code
Scala
primary language
1
measurement over time
What this system is
mongo4cats is a functional Scala library that provides reactive MongoDB client abstractions built on top of the Java MongoDB driver. It supports both Cats Effect and ZIO effect systems, offering core capabilities for CRUD operations, aggregation pipelines, change streams, and transactional sessions. The system also includes integration modules for Circe and ZIO-JSON to handle BSON serialization, along with embedded MongoDB support for testing.
How it got here
2020–2021 — Initial setup and modularization
7 changes.
The project was initialized with core infrastructure, build tooling, and documentation, followed by a migration to sbt 2.0 and a restructuring into a multi-module architecture. This period also involved removing obsolete example code while introducing comprehensive examples and tests for key MongoDB integration features.
2022–2024 — Initial library release and documentation
20 changes.
This period covers the initial development and release of the mongo4cats library, establishing core abstractions for MongoDB operations with support for Cats Effect and ZIO runtimes. It includes the implementation of BSON serialization, JSON integration modules for Circe and ZIO-JSON, and comprehensive test suites to ensure reliability. The work also encompasses the creation of embedded MongoDB support for testing and the launch of a Docusaurus-based documentation website.
Features
Add Circe-based JSON mapping and codecs for BSON values
This change introduces the Circe integration module, providing \CirceJsonMapper\ to convert between Circe \Json\ and MongoDB BSON values, including support for binary arrays and UUIDs. It also adds \MongoJsonCodecs\ to supply Circe \Encoder\ and \Decoder\ instances for core types such as \Document\, \ObjectId\, \Instant\, \LocalDate\, \UUID\, and binary data, enabling seamless serialization and deserialization using the Circe library.
modules/circe/src/main · high confidence
Add ZIO-JSON integration for BSON-to-JSON mapping
This change introduces a new ZIO-JSON implementation for the mongo4cats library, enabling users to convert between BSON and JSON using the ZIO-JSON library. The new \ZioJsonMapper\ and \MongoJsonCodecs\ components provide encoders and decoders for core types including \Document\, \ObjectId\, \Instant\, \LocalDate\, \UUID\, and binary arrays, allowing seamless serialization and deserialization of MongoDB data structures using ZIO-JSON's \JsonEncoder\ and \JsonDecoder\ types.
modules/zio-json/src/main · high confidence
Add embedded MongoDB support for Cats Effect and ZIO
New \EmbeddedMongo\ traits and objects have been added to the \modules/embedded\ (Cats Effect) and \modules/zio-embedded\ (ZIO) modules, enabling tests to spin up a local MongoDB instance automatically. The implementation defaults to MongoDB version 7.0.0, supports custom ports and optional authentication credentials, and includes a retry mechanism with a 100ms delay to handle startup failures.
modules/embedded · high confidence
Add static assets for Docusaurus documentation site
Added static files to support the new Docusaurus-based documentation site, including a \.nojekyll\ file to prevent GitHub Pages from processing the site with Jekyll, a new custom SVG logo, and the MongoDB logo SVG.
website/static · high confidence
Initial Docusaurus-based documentation site with styled homepage
The website source now uses Docusaurus to render a documentation site, introducing a new homepage that displays the project title, tagline, and a detailed introduction to the mongo4cats library. This includes installation instructions for Scala (via sbt) and quick-start code examples for both Cats Effect and ZIO runtimes. The visual presentation is defined by custom CSS variables for primary colors in light and dark modes, along with scoped module styles for the hero banner and content sections.
website/src · high confidence
Initial project setup and tooling configuration
The repository has been initialized with core project infrastructure, including an Apache 2.0 license, a comprehensive README with usage examples for Cats Effect and ZIO, and build configuration files. Developer tooling is established via \.sbtopts\ for JVM memory settings, \.sbtrc\ for SBT aliases (formatting, testing, dependency updates), and \.scalafmt.conf\ upgraded to version 3.11.1 with updated formatting rules. The \.gitignore\ has been updated to exclude IDE artifacts, build outputs, and Docusaurus website dependencies.
(repo-wide) · high confidence
Initial release of core MongoDB client and database abstractions
This change introduces the foundational \MongoClient\ and \MongoDatabase\ components for the mongo4cats library. The \MongoClient\ provides factory methods to create connections via connection strings or server addresses, automatically configuring UUID representation to STANDARD, and manages client lifecycle using Cats Effect Resources. It also introduces \ClientSession\ support, allowing users to start sessions as auto-closable resources for transactional operations. The \MongoDatabase\ implementation exposes standard database operations such as listing collections, retrieving collections with codec registries, running commands, and dropping the database, while ensuring proper resource management and integration with the underlying Java MongoDB reactive driver.
modules/core/src/main/scala/mongo4cats/client · high confidence
Initial release of mongo4cats core library and examples
This change introduces the initial version of the mongo4cats library, providing a functional Scala API for MongoDB. It includes core data models for BSON values and Documents, query builders for find, aggregate, and change streams, and support for Circe and ZIO-JSON codecs, along with example applications demonstrating usage.
repository · high confidence
Introduce ZIO-based MongoDB client, database, and collection implementations
This change adds the ZIO integration layer for mongo4cats, providing \ZMongoClient\, \ZMongoDatabase\, and \ZMongoCollection\ implementations that wrap the underlying reactive MongoDB drivers in ZIO effects. The client factory methods now explicitly set \UuidRepresentation.STANDARD\ for consistent UUID handling, and session management is handled via ZIO \Scope\-managed resources to ensure proper cleanup. The module also includes syntax extensions for converting reactive publishers into ZIO tasks and streams, enabling seamless integration of MongoDB operations within ZIO applications.
modules/zio/src/main · high confidence
Introduces core BSON serialization, codec providers, and Scala/Java interop utilities
The kernel module now includes the foundational infrastructure for BSON serialization and type conversion. This adds \BsonValueEncoder\ and \BsonValueDecoder\ traits with implicit instances for common types (including \UUID\, \BigInt\, and \BigDecimal\), alongside specific \CodecProvider\ implementations for \Document\, \Iterable\, \Map\, \Option\, \BigDecimal\, \BigInt\, and \BsonValue\. It also introduces \ContainerValueReader\ and \ContainerValueWriter\ for low-level BSON stream handling, \AsJava\/\AsScala\ traits for collection interoperability (with version-specific implementations for Scala 2.12, 2.13, and 3), and a \Uuid\ helper object for standard UUID binary encoding.
modules/kernel/src/main · high confidence
Launch of mongo4cats documentation website
The project now includes a dedicated documentation website built with Docusaurus, hosted at /mongo4cats/. This site provides structured guides for getting started, performing operations, and integrating with embedded MongoDB, Circe, and ZIO. It features a dark-themed UI, syntax highlighting for Java and Scala, and a sidebar navigation system to help users quickly find API references and usage examples.
website · high confidence
New MongoCollection API with Stream-based change streams
The core collection module now exposes a new \MongoCollection\ API that wraps the MongoDB Java reactive client. This implementation provides standard CRUD operations (find, insert, update, delete) and aggregation pipelines. A key behavioral change is that the \watch\ method now returns a \Stream\[F, \*\]\ (via \Queries.Watch\), enabling users to consume change stream events as a continuous stream rather than a single document, which aligns with the reactive nature of the underlying driver.
modules/core/src/main/scala/mongo4cats/collection · high confidence
New example applications for bulk writes, transactions, change streams, and ZIO integration
Added nine new Scala example programs in the examples directory demonstrating key mongo4cats capabilities: BulkWrites shows batch insert, update, and delete operations; Documents illustrates BSON value construction and document manipulation; FilteringAndSorting covers query filters, sorting, and cursor options; Indexing demonstrates index creation and listing; JsonDocumentFindAndUpdate shows JSON parsing and find-and-update workflows; Transactions provides a complete example of starting, committing, and aborting database transactions; Watch illustrates change stream monitoring; WithEmbeddedMongo shows how to run tests against an embedded MongoDB instance; and Zio demonstrates integration with the ZIO effect system using ZIO layers.
examples/src/main/scala · high confidence
New syntax extensions for Publisher and Option conversions
Added a new \syntax.scala\ file providing implicit extension methods for \Publisher\[T\]\ and \F\[Option\[T\]\]\. Users can now convert Reactive Streams Publishers into Cats Effect types using \asyncSingle\, \asyncVoid\, \asyncIterable\, and \stream\ (including bounded streams), and safely unwrap \Option\ values with \unNone\, which throws a \MongoEmptyStreamException\ if the option is empty.
modules/core/src/main/scala/mongo4cats · high confidence
Removals
Removal of example Hello application
The example Hello application (src/main/scala/example/Hello.scala) has been removed from the codebase. This eliminates the sample code that previously demonstrated a simple Greeting trait and its usage.
src/main · high confidence
Behavioural changes
Migrate build infrastructure to sbt 2.0 and modernize dependency management
The project's build system has been upgraded from sbt 1.3.9 to sbt 2.0.3, introducing a new modular dependency structure defined in \project/Dependencies.scala\. This change replaces the previous monolithic dependency list with distinct configuration sequences for \kernel\, \core\, \examples\, \circe\, \zioJson\, \zio\, \embedded\, and \zioEmbedded\ modules. Additionally, new SBT plugins have been added for code formatting, header management, binary compatibility checking, and CI release automation, while utility functions in \project/Utils.scala\ now handle Scala version-specific compiler plugins and options.
project · high confidence
Test coverage
Added ZIO integration tests for MongoDB client, database, and collection operations; Added comprehensive test coverage for BSON Document operations; Added comprehensive test suite for core MongoDB client functionality; Added test coverage for Circe JSON mapping and codecs; Added test for embedded MongoDB integration; Added test suite for UUID conversion and shared test data; Added test utilities and model definitions for kernel tests; Added tests for zio-json integration codecs and mappers; Added unit tests for Filter, Projection, and Update operations; Removed HelloSpec test suite.
Dependencies
Website dependency lockfiles and build configuration
The website module now includes \package.json\ and \package-lock.json\ files, establishing a Node.js dependency tree for the Docusaurus-based documentation site (using \@docusaurus/core\ 3.1.0 and React 18). Additionally, the \build.sbt\ file has been significantly refactored to support a multi-module Scala project structure, introducing dedicated modules for the kernel, core, ZIO integration, Circe, and ZIO-JSON, while also updating the Scala versions to support 2.12, 2.13, and 3.3.7.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 64.
Lenses
- Code Health 94
- Architecture 99
- Maturity 64
- Readiness 49
- Security 82
- Domain Modelling 100
Changes since last survey
- 300 commits — 275 feature/other, 25 fixes
By area
- (root) — 111 commits
- modules/kernel — 69 commits
- project/Dependencies.scala — 19 commits
- modules/circe — 15 commits
- modules/core — 14 commits
- website/docs — 7 commits
- (repo) — 6 commits
- website/package-lock.json — 6 commits
- website/src — 6 commits
- .github/workflows — 5 commits
- circe/src — 5 commits
- examples/src — 4 commits
- kernel/src — 4 commits
- modules/zio — 4 commits
- website/docusaurus.config.js — 4 commits
- core/src — 3 commits
- modules/embedded — 3 commits
- project/build.properties — 3 commits
- docs/src — 2 commits
- embedded/src — 2 commits
Notable commits
- fix: Fix URL constructor warning in sbt (#41)
- fix: Fix ZClientSessionLive#commitTransaction and #abortTransaction Ignore Result (#29)
- fix: Fix first method on aggregate query. (#35)
- fix: Fix deprecation warning
- fix: Fix docs link
- fix: Fix drop implementation in ZMongoDatabase
- fix: Fix field order preservation in scala 2.12
- fix: Fix isUuid impl
- fix: Fix java doc for $set (#46)
- fix: Fix links
- fix: Fix numeric conversion in CirceJsonMapper
- fix: Fix scala 2.12 compilation error
- fix: Fix test
- fix: Fix test
- fix: Fix test
- fix: Fix test for scala 2.12
- fix: Fix tests
- fix: Fix vector search options
- fix: Fix version
- fix: Fix zio-json compilation error
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
Kirill5k/mongo4cats was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 8b1510b1babff2d99662f5e3fc70a2d24c70dee1 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.