Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. MongoDB
  3. mongodb

mongodb

Apache-2.0Elixir

A deprecated Elixir driver for MongoDB, replaced by mongodb_driver.

GitHubGitHub
564 stars151 forks0 contributors

What is mongodb?

MongoDB is an Elixir driver for interacting with MongoDB databases, providing a native Elixir interface for database operations. It supports connection pooling, streaming cursors, replica sets, sessions, transactions, and the aggregation pipeline. However, this project is deprecated and users are advised to migrate to mongodb_driver instead.

Target Audience

Elixir developers building applications that use MongoDB as a backend data store, particularly those who need a driver that integrates with the Elixir ecosystem and supports MongoDB features like replica sets and transactions.

Value Proposition

Developers chose this driver for its correctness and compatibility with the official MongoDB driver specification, seamless integration into Elixir (e.g., through connection pooling via db_connection), and support for advanced MongoDB features like BSON encoding/decoding for Elixir structs.

Overview

MongoDB driver for Elixir

Use Cases

Best For

  • Building Elixir applications that require efficient connection pooling to MongoDB databases.
  • Handling large datasets in Elixir with streaming cursors for performance.
  • Connecting to MongoDB replica sets for high availability and fault tolerance in Elixir projects.
  • Implementing ACID transactions and sessions in Elixir applications using MongoDB.
  • Performing complex data processing with MongoDB aggregation pipelines in Elixir.
  • Encoding and decoding BSON data types with custom protocols for Elixir structs.

Not Ideal For

  • Teams starting new Elixir projects with MongoDB that require long-term maintenance and updates.
  • Applications needing the latest MongoDB driver features or compatibility with newer database versions beyond 5.0.
  • Developers using Ecto with MongoDB, as mongodb_ecto has migrated to mongodb_driver, making this driver obsolete for such integrations.

Pros & Cons

Pros

Efficient Connection Pooling

Leverages db_connection for configurable pool management, allowing optimized resource usage in Elixir applications, as demonstrated in the supervisor setup examples.

Streaming Cursors Support

Enables efficient handling of large datasets with enumerable cursors, providing performance benefits for data-intensive operations, highlighted in the README's usage section.

Comprehensive Feature Set

Supports advanced MongoDB features like replica sets, sessions, transactions, and aggregation pipelines, ensuring compatibility with the official driver specification.

Custom BSON Encoding

Allows implementing the Mongo.Encoder protocol for custom Elixir structs, offering flexibility in data representation, as shown in the encoding example.

Cons

Deprecated and Unmaintained

Explicitly marked as deprecated in the README, with no future updates or security patches, forcing migration to mongodb_driver for any ongoing development.

Breaking Migration Path

Migration to mongodb_driver involves significant changes, such as altered return types for functions like find_one_and_replace, adding complexity and potential downtime.

Limited Ecosystem Integration

With mongodb_ecto switching to mongodb_driver, this driver lacks seamless compatibility with key Elixir libraries, reducing its utility in modern stacks.

Outdated Documentation

While documentation exists online, it may not reflect current best practices or address issues arising from the deprecation, hindering troubleshooting.

Frequently Asked Questions

Quick Stats

Stars564
Forks151
Contributors0
Open Issues18
Last commit1 year ago
CreatedSince 2014

Tags

#bson#elixir#replica-sets#driver#connection-pooling#aggregation#mongodb#database-client#transactions#mongodb-driver

Built With

E
Elixir

Included in

MongoDB2.6k
Auto-fetched 12 hours ago

Related Projects

mongodb_ectomongodb_ecto

MongoDB adapter for Ecto

Stars378
Forks127
Last commit3 days ago
mongodb_drivermongodb_driver

MongoDB driver for Elixir

Stars270
Forks88
Last commit1 month ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub