Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
197 changes: 197 additions & 0 deletions source/odm.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
=========================
ORMs, ODMs, and Libraries
=========================

.. facet::
:name: genre
:values: reference

.. meta::
:description: MongoDB has ORMs, ODMs, and Libraries to simplify interactions between your app and cluster. Use the best database for Ruby, Python, Java, C#, Node.js, PHP.

Check failure on line 10 in source/odm.txt

View workflow job for this annotation

GitHub Actions / TDBX Vale rules

[vale] reported by reviewdog 🐶 [MongoDB.CommaOxford] Use the Oxford comma in ' MongoDB has ORMs, ODMs, and Libraries to simplify interactions between your app and '. Raw Output: {"message": "[MongoDB.CommaOxford] Use the Oxford comma in ' MongoDB has ORMs, ODMs, and Libraries to simplify interactions between your app and '.", "location": {"path": "source/odm.txt", "range": {"start": {"line": 10, "column": 17}}}, "severity": "ERROR"}
:keywords: Object Oriented, abstraction, serialization, relational,

.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: twocols


`MongoDB Drivers <https://www.mongodb.com/docs/drivers/>`__ offer idiomatic APIs
and helpers for most programming languages, but some applications are suited to higher level
abstraction. In particular, developers may be used to interacting with data in a
more declarative fashion, for example by using ActiveRecord for Ruby. `Object-Relational Mappers
<https://en.wikipedia.org/wiki/Object%E2%80%93relational_mapping>`__ (or ORMs)
can improve the developer experience customizing database interactions in the
following ways:

* Abstracting away the need for query language.
* Managing serialization/deserialization of data into objects.
* Enforcing schema requirements.

Because MongoDB is a non-relational database management system, ORMs are
sometimes referred to as ODMs (Object Document Mappers), but the terms can be
used interchangeably in the MongoDB domain. MongoDB, our
`community
<https://www.mongodb.com/docs/drivers/community-supported-drivers/>`__, and our
partners provide several ODM libraries.

The following are some examples of the best MongoDB ODM libraries for a number
of programming languages, including Ruby, Python, Java, C#, Node.js, and PHP.

Ruby
----

Mongoid
~~~~~~~

The Mongoid ODM provides API parity with Rails wherever possible to ensure
developers that are used to working with a `Ruby on Rails
<https://rubyonrails.org/>`__ framework can use the methods and mechanics
they’re already familiar with in ActiveRecord.

See the `Mongoid documentation
<https://www.mongodb.com/docs/mongoid/current/>`__ for more information.

Python
------

Beanie
~~~~~~

Beanie is a third-party, asynchronous Python ODM based on `Pydantic
<https://pydantic-docs.helpmanual.io/>`__. Beanie uses corresponding documents
to interact with each database collection, and supports adding, updating, and
deleting documents. Beanie saves you time by removing boilerplate code, and it
helps you focus on the parts of your app that actually matter.

See the `Beanie documentation <https://beanie-odm.dev/>`__ for more information.

MongoEngine
~~~~~~~~~~~

MongoEngine is a third-party, synchronous Python ORM for MongoDB. It uses a
simple declarative API and is built on top of the
`MongoDB PyMongo Driver <https://www.mongodb.com/docs/drivers/pymongo/>`__.

See the `MongoEngine documentation <https://mongoengine-odm.readthedocs.io/>`__
for more information.

Django
~~~~~~

Django MongoDB Backend is the official MongoDB integration for Django and
MongoDB. This integration supports many core Django features, including the
Django ORM. It translates Django ORM methods into equivalent MongoDB queries,
allowing developers to use the familiar Django interface.

See the `Django MongoDB Backend documentation
<https://www.mongodb.com/docs/languages/python/django-mongodb/current>`__ for
more information.


Java
----

Spring Data MongoDB
~~~~~~~~~~~~~~~~~~~

Spring Data MongoDB is a third-party Java ORM for MongoDB. The `Spring Data
<https://spring.io/projects/spring-data>`__ project provides a familiar and
consistent Spring-based programming model which is enhanced by
MongoDB-specific features and capabilities. Spring Data MongoDB uses a
POJO-centric model for interacting with collections and writing repository-style
data access layers.

See the `Spring Data MongoDB documentation
<https://spring.io/projects/spring-data-mongodb>`__ or the `Spring Boot
Integration with MongoDB Tutorial
<https://www.mongodb.com/compatibility/spring-boot>`__ for more information.

.. TODO: Hibernate

.NET/C#
-------

Entity Framework
~~~~~~~~~~~~~~~~

MongoDB Entity Framework Core Provider (EF Core Provider) is the official
intergration for MongoDB and EF Core. It allows developers
using C# in the .NET ecosystem to use `Entity Framework Core
<https://learn.microsoft.com/en-us/ef/>`__ as their ODM which provides a
familiar API interface, query paradigm (LINQ), and design pattern.

See the `EF Core provider documentation
<https://www.mongodb.com/docs/entity-framework/current/>`__ for more
information.

Node.js
-------

Mongoose
~~~~~~~~

Mongoose is a third-party Node.js-based ODM library for MongoDB. It enforces a specific
schema at the application layer and offers a variety of hooks, model validation,
and other features.

See the `Mongoose documentation <https://mongoosejs.com/>`__ or `MongoDB &
Mongoose: Compatibility and Comparison
<https://www.mongodb.com/developer/languages/javascript/mongoose-versus-nodejs-driver/>`__
for more information.

Prisma
~~~~~~

Prisma is a third-party ODM for Node.js and Typescript that fundamentally differs from
traditional ORMs. It uses declarative Prisma schemas as the single
source of truth for both your database schema and models. The Prisma client
reads and writes data in a type-safe manner, and returns plain JavaScript objects.

See `Prisma & MongoDB <https://www.prisma.io/mongodb>`__ for more information.

PHP
---

Doctrine
~~~~~~~~

Doctrine is a third-party PHP MongoDB ODM. This library provides PHP object mapping
functionality and transparent persistence for PHP objects to MongoDB, as well as

Check failure on line 161 in source/odm.txt

View workflow job for this annotation

GitHub Actions / TDBX Vale rules

[vale] reported by reviewdog 🐶 [MongoDB.ConciseTerms] 'and' is preferred over 'as well as'. Raw Output: {"message": "[MongoDB.ConciseTerms] 'and' is preferred over 'as well as'.", "location": {"path": "source/odm.txt", "range": {"start": {"line": 161, "column": 71}}}, "severity": "ERROR"}
a mechanism to map embedded or referenced documents. It can also create
references between PHP documents in different databases and work with `GridFS
buckets <https://www.mongodb.com/docs/php-library/current/write/gridfs/>`__.

See the `Doctrine MongoDB ODM documentation
<https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/index.html>`__
for more information.

Symfony
~~~~~~~

The Doctrine MongoDB ODM can be used to integrate MongoDB with
the Symfony PHP framework. Doctine's object mapping enables developers to get
the benefits of MongoDB features, such as flexible schema design
and advanced searches, alongside Symfony's reusable components and streamlined
web design.

See the `Symfony MongoDB Integration page
<https://www.mongodb.com/docs/drivers/php-frameworks/symfony/>`__ for more
information.

.. TODO? Drupal

Laravel
~~~~~~~

Laravel MongoDB is the official integration for MongoDB and Laravel. It extends
methods in the PHP Laravel API to provide developers the full suite of Laravel's
Eloquent and Query Builder features while using MongoDB as their datastore.
With this package, Laravel developers can take advantage of MongoDB's flexible schema
and extensive capabilities, while maintaining familiar patterns, relationships,
and features such as querying, caching, and more.

See the `Laravel MongoDB documentation
<https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current/>`__ for more
information.
1 change: 1 addition & 0 deletions source/other-document-dbs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Other Document Database Compatibility

/documentdb-support
/cosmosdb-support
/odm

See the following pages for information about other document databases' compatibility
with MongoDB:
Expand Down
Loading