zookzook/elixir-mongodb-driver
49.7
Weak · 18 September 2026
12.1k
lines of production code
Elixir
primary language
1
measurement over time
What this system is
This system is a MongoDB driver for Elixir that provides core database operations including CRUD, bulk writes, and transaction handling. It supports advanced features such as GridFS for file storage, change streams for real-time monitoring, and comprehensive authentication mechanisms. The library also includes utilities for schema migrations, connection pooling, and telemetry, alongside a Phoenix-based application for exposing internal driver metrics.
How it got here
2014 — Initial project scaffolding and driver release
6 changes.
This period established the foundational structure for the Elixir MongoDB driver, including repository configuration, code formatting rules, and dependency management. It introduced the core BSON serialization library and the primary Mongo client module with essential database operations, connection pooling, and transaction support. A comprehensive test suite was also implemented to validate BSON encoding/decoding and integration with MongoDB features.
2015–2018 — MongoDB driver core and GridFS implementation
11 changes.
This period focused on building a comprehensive MongoDB driver core, introducing structured bulk writes, change streams, and expanded authentication mechanisms. It also added initial GridFS support for file storage and significantly expanded test coverage, including specification tests and infrastructure for validating CRUD operations and driver resilience.
2019–2026 — MongoDB driver hardening and migration support
6 changes.
This period focused on stabilizing the MongoDB connection layer by hardening TLS negotiation and introducing a new utility module for protocol handling. It also established robust server-side session management with pooling to improve performance, alongside comprehensive test coverage for these changes. Additionally, the work introduced essential migration management tasks for schema evolution and scaffolded a new Phoenix-based Insights application.
Features
Added migration management tasks for MongoDB
New Mix tasks have been added to allow users to manage database schema changes over time. Users can now generate migration files using \mix mongo.gen.migration\, apply pending changes with \mix mongo.migrate\, roll back the last migration with \mix mongo.drop\, reset the database state with \mix mongo.reset\, and unlock the migration lock with \mix mongo.unlock\. These tasks handle versioning via a dedicated \migrations\ collection and support configuration for paths, OTP applications, and topologies.
lib/tasks · high confidence
Added server-side session management and pooling
The library now includes dedicated modules for managing MongoDB server sessions and a FIFO-based session pool. This introduces a \ServerSession\ struct to track session state (such as transaction numbers and expiration) and a \SessionPool\ that caches and reuses these sessions to improve performance and reduce overhead when creating many sessions.
lib/session · high confidence
Expanded authentication mechanism support
The library now supports additional MongoDB authentication mechanisms, including PLAIN, X.509, and CR (Challenge-Response). The SCRAM implementation has also been updated to support both SCRAM-SHA-256 and SCRAM-SHA-1, with automatic selection based on server capabilities. These changes allow users to authenticate against MongoDB instances that require these specific mechanisms.
lib/mongo/auth · high confidence
Initial BSON encoding and decoding implementation
This change introduces the core BSON serialization and deserialization capabilities for the library. It adds new modules to handle encoding and decoding of BSON data, including support for Decimal128, ObjectIds, Binary types, and various primitive types. The implementation includes both encoder and decoder logic, along with utility functions and type definitions necessary for BSON processing.
lib/bson · high confidence
Initial GridFS support for file uploads and downloads
Added the \Mongo.GridFs\ module to enable storing and retrieving large files in MongoDB using the GridFS specification. Users can now create a \Bucket\ to manage the underlying \fs.files\ and \fs.chunks\ collections, upload files via streaming with \open\_upload\_stream\, and download files with \open\_download\_stream\. The implementation handles chunking, index creation, and file metadata, providing a standard interface for GridFS operations within the driver.
_lib/mongo/grid\fs · high confidence
Initial project scaffolding and configuration
The repository has been initialized with essential configuration files for the Elixir MongoDB driver, including a \.credo.exs\ for static code analysis, a \.formatter.exs\ defining code formatting rules, and a \.tool-versions\ file specifying Erlang/OTP 27.2.2 and Elixir 1.18.2. The project also includes a comprehensive \CHANGELOG.md\ documenting history up to version 1.6.4, an Apache 2.0 \LICENSE\, a \.gitignore\ for build artifacts, and a \README.md\ detailing installation, usage, and supported features like connection pooling, GridFS, and change streams.
(repo-wide) · high confidence
Initial release of the MongoDB Elixir driver
This change introduces the initial version of the MongoDB driver for Elixir. It adds the core \Mongo\ module for executing database operations (such as \start\_link\, \find\, \insert\_one\, and \update\_one\) and a new \BSON\ module for encoding and decoding BSON documents. The implementation includes support for connection pooling via \DBConnection\, server topology management, authentication, and transaction handling, while removing the previous placeholder \Mongodb\ module.
lib · high confidence
Introduce structured MongoDB driver core with bulk writes, change streams, and event telemetry
The \lib/mongo\ directory has been restructured into a comprehensive driver implementation. This update adds support for ordered and unordered bulk writes (including stream-based processing) to significantly improve write performance, and introduces Change Streams with automatic resume token handling for real-time data monitoring. It also implements a new event system using Elixir's Registry to broadcast command and topology events for external telemetry, and provides a \Collection\ module with macros to automate struct serialization (load/dump) for Elixir applications.
lib/mongo · high confidence
New Insights application scaffolding
A new Phoenix-based application named 'Insights' has been added to the project. This includes the standard Phoenix project structure, configuration files, and a README for local development. The application is styled with Bootstrap v5.0.2 and includes custom CSS for list group styling, alerts, and LiveView-specific animations (fade-in/out, modal handling).
insights · high confidence
New example projects for CRUD, change streams, and replica set resilience
Added three new example projects to the \examples/\ directory to demonstrate key MongoDB driver capabilities. The \crud\_example\ project provides a standalone Mix application showing basic Create, Read, Update, and Delete operations, including both direct connection and pooled connection patterns, with a Docker Compose setup for easy local testing. The \change\_stream\ project demonstrates how to implement a GenServer-based change stream watcher that handles resume tokens and monitors cursor processes for reconnection. The \reader.ex\ script illustrates handling replica set failovers by continuously reading data and logging errors when stepping down the primary node.
examples · high confidence
Behavioural changes
Improved TLS compatibility and new utility module for MongoDB connections
The MongoDB connection layer now includes a new \Mongo.MongoDBConnection.Utils\ module to handle low-level request/response encoding and decoding, including support for the \op\_msg\ protocol structure. Additionally, TLS negotiation has been hardened: when users supply cipher suites that are incompatible with TLS 1.3, the driver now automatically restricts the TLS versions to exclude 1.3, preventing handshake failures that previously occurred due to Erlang's SSL implementation not falling back gracefully.
_lib/mongo\_db\connection · high confidence
Updated Elixir configuration syntax and enabled MongoDB migration defaults
The application configuration has been migrated from the legacy \use Mix.Config\ syntax to the modern \import Config\ module, aligning with Elixir 1.15+ standards. Additionally, default settings for the MongoDB driver are now explicitly defined in the main config file, enabling logging and specifying the migration path (\mongo/migrations\), while environment-specific files (dev, prod, test) are introduced to handle per-environment overrides such as the test database URL.
config · high confidence
Test coverage
Added specification tests for CRUD operations; Added test coverage for BSON types and decoding behavior; Added test fixtures for migration scenarios; Added test helpers for MongoDB CRUD specification tests; Added test support infrastructure for MongoDB driver testing; Added tests for TLS version restriction logic; Added tests for inlined collections and timestamp handling; Added unit tests for GridFS bucket, upload, and download operations; Expanded test coverage for MongoDB driver features; Initial test suite for BSON encoding/decoding and MongoDB operations.
Dependencies
MongoDB driver v1.6.4 release with Elixir 1.15 support and dependency updates
The main \mongodb\_driver\ project has been updated to version 1.6.4, raising the minimum Elixir requirement to 1.15 and adding support for the \ezstd\ library (zstd compression). The dependency list now includes \telemetry \~\> 1.0\, \db\_connection \~\> 2.6\, and \decimal \~\> 2.1/3.0\. Additionally, new example projects for change streams and CRUD operations have been added, both depending on \mongodb\_driver \~\> 0.5\, and a new \insights\ Phoenix application has been introduced to expose internal driver data structures, depending on \mongodb\_driver\ via a path override and including \prom\_ex\ for metrics.
(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 50.
Lenses
- Code Health 97
- Architecture 98
- Maturity 61
- Readiness 33
- Security 87
- Accessibility 50
Changes since last survey
- 300 commits — 228 feature/other, 72 fixes
By area
- (root) — 112 commits
- lib/mongo — 88 commits
- (repo) — 27 commits
- lib/mongo.ex — 18 commits
- .github/workflows — 16 commits
- test/mongo — 15 commits
- lib/bson — 11 commits
- insights/lib — 2 commits
- test/collections — 2 commits
- test/support — 2 commits
- .github/workflow — 1 commit
- lib/tasks — 1 commit
- test/bson_test.exs — 1 commit
- test/data — 1 commit
- test/mongo_test.exs — 1 commit
- test/specification_tests — 1 commit
- test/test_helper.exs — 1 commit
Notable commits
- fix: #63: fixed wire version in change streams, removed some compiler warnings
- fix: Bump ex_doc and fix some doc issues (#181)
- fix: FIX-216: Allow passing optional file_id while uploading to gridfs (#217)
- fix: Fix few README text issues (#221)
- fix: Fix for serializing BSON Regex without options.
- fix: Fix insert_many documentation typo (#239)
- fix: Fix links to source code from documentation (#241)
- fix: Fix mongo.drop task and add error handling (#153)
- fix: Fix some typespecs (#173)
- fix: Fix: Fix Object ID decoding logic for uppercase HEX string (#274)
- fix: Fixed #96
- fix: Fixed SSL IP address verification (#244)
- fix: Fixed minor bug parsing url connection. Updated dependencies libraries. (#209)
- fix: Remove unused typespecs, fix typespec (#250)
- fix: Review fixes
- fix: chore: fix test script
- fix: chore: fix unit test
- fix: chore: fixed read preference workflow and added the RTT function to the monitor process
- fix: chore: updated readme regarding mongodb_ecto, fixed some specs
- fix: fix (#120): remove a compiler warning
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
zookzook/elixir-mongodb-driver 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 18 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 0cb1282207bde083f3fdeebd33002455b664a18c — 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-5d04157a340d.