You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
can improve the developer experience customizing database interactions in the
@@ -33,97 +33,165 @@ Because MongoDB is a non-relational database management system, ORMs are
33
33
sometimes referred to as ODMs (Object Document Mappers), but the terms can be
34
34
used interchangeably in the MongoDB domain. MongoDB, our
35
35
`community
36
-
<https://www.mongodb.com/docs/drivers/community-supported-drivers/>`__ and our
36
+
<https://www.mongodb.com/docs/drivers/community-supported-drivers/>`__, and our
37
37
partners provide a number of ODM libraries.
38
38
39
39
The following are some examples of the best MongoDB ODM libraries for a number
40
-
of programming languages, including Ruby, Python, Java, Node.js, and PHP.
40
+
of programming languages, including Ruby, Python, Java, C#, Node.js, and PHP.
41
41
42
-
## Beanie
42
+
Ruby
43
+
----
43
44
44
-
Beanie is an Asynchronous Python object-document mapper (ODM) for MongoDB, based on `Motor <https://www.mongodb.com/docs/drivers/motor/>`__ (an asynchronous MongoDB driver) and `Pydantic <https://pydantic-docs.helpmanual.io/>`__.
45
+
Mongoid
46
+
~~~~~~~
45
47
46
-
When using Beanie, each database collection has a corresponding document that is used to interact with that collection. In addition to retrieving data, Beanie allows you to add, update, and delete documents from the collection. Beanie saves you time by removing boilerplate code, and it helps you focus on the parts of your app that actually matter.
48
+
The Mongoid ODM provides API parity with Rails wherever possible to ensure
49
+
developers that are used to working with a `Ruby on Rails
50
+
<https://rubyonrails.org/>`__ framework can use the methods and mechanics
51
+
they’re already familiar with in ActiveRecord.
52
+
53
+
See the `Mongoid documentation
54
+
<https://www.mongodb.com/docs/mongoid/current/>`__ for more information.
55
+
56
+
Python
57
+
------
58
+
59
+
Beanie
60
+
~~~~~~
61
+
62
+
Beanie is a third-party, asynchronous Python ODM based on `Pydantic
Doctrine is a PHP MongoDB ORM, even though it’s referred to as an ODM. This library provides PHP object mapping functionality and transparent persistence for PHP objects to MongoDB, as well as a mechanism to map embedded or referenced documents. It can also create references between PHP documents in different databases and work with GridFS buckets.
77
+
See the `MongoEngine documentation <https://mongoengine-odm.readthedocs.io/>`__
78
+
for more information.
53
79
54
-
See the `Doctrine MongoDB ODM documentation <https://www.doctrine-project.org/projects/doctrine-mongodb-odm/en/latest/index.html>`__ for more information.
80
+
Java
81
+
----
55
82
56
-
## Mongoid
83
+
Spring Data MongoDB
84
+
~~~~~~~~~~~~~~~~~~~
57
85
58
-
Most Ruby-based applications are built using the `Ruby on Rails <https://rubyonrails.org/>`__ framework. As a result, Rails’ `Active Record <https://guides.rubyonrails.org/active_record_basics.html>`__ implementation, conventions, CRUD API, and callback mechanisms are second nature to Ruby developers. So, as far as a MongoDB ORM for Ruby, the Mongoid ODM provides API parity wherever possible to ensure developers working with a Rails application and using MongoDB can do so using methods and mechanics they’re already familiar with.
86
+
Spring Data MongoDB is a third-party Java ORM for MongoDB. The `Spring Data
87
+
<https://spring.io/projects/spring-data>`__ project provides a familiar and
88
+
consistent Spring-based programming model which is enhanced by
89
+
MongoDB-specific features and capabilities. Spring Data MongoDB uses a
90
+
POJO-centric model for interacting with collections and writing repository-style
91
+
data access layers.
59
92
60
-
See the `Mongoid documentation <https://www.mongodb.com/docs/mongoid/current/>`__ for more information.
93
+
See the `Spring Data MongoDB documentation
94
+
<https://spring.io/projects/spring-data-mongodb>`__ or the `Spring Boot
95
+
Integration with MongoDB Tutorial
96
+
<https://www.mongodb.com/compatibility/spring-boot>`__ for more information.
61
97
62
-
## Mongoose
98
+
.. TODO: Hibernate
63
99
64
-
If you’re seeking an ORM for NodeJS and MongoDB, look no further than Mongoose. This Node.js-based Object Data Modeling (ODM) library for MongoDB is akin to an Object Relational Mapper (ORM) such as `SQLAlchemy <https://www.sqlalchemy.org/>`__. The problem that Mongoose aims to solve is allowing developers to enforce a specific schema at the application layer. In addition to enforcing a schema, Mongoose also offers a variety of hooks, model validation, and other features aimed at making it easier to work with MongoDB.
100
+
.NET/C#
101
+
-------
65
102
66
-
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.
103
+
Entity Framework
104
+
~~~~~~~~~~~~~~~~
67
105
68
-
## MongoEngine
106
+
MongoDB Entity Framework Core Provider (EF Core Provider) is the official
107
+
intergration for MongoDB and EF Core. It allows developers
108
+
using C# in the .NET ecosystem to use `Entity Framework Core
109
+
<https://learn.microsoft.com/en-us/ef/>`__ as their ODM which provides a
110
+
familiar API interface, query paradigm (LINQ), and design pattern.
69
111
70
-
MongoEngine is a Python ORM for MongoDB. Branded as a Document-Object Mapper, it uses a simple declarative API, similar to the Django ORM.
112
+
See the `EF Core provider documentation
113
+
<https://www.mongodb.com/docs/entity-framework/current/>`__ for more
114
+
information.
71
115
72
-
It was first released in 2015 as an open-source project, and the current version is built on top of `PyMongo <https://www.mongodb.com/docs/drivers/pymongo/>`__, the official Python Driver by MongoDB.
116
+
Node.js
117
+
-------
73
118
74
-
See the `MongoEngine documentation <http://mongoengine.org/>`__ for more information.
119
+
Mongoose
120
+
~~~~~~~~
75
121
76
-
## Prisma
122
+
Mongoose is a third-party Node.js-based ODM library for MongoDB. It enforces a specific
123
+
schema at the application layer and offers a variety of hooks, model validation,
124
+
and other features.
77
125
78
-
Prisma is a `new kind of ORM <https://www.prisma.io/docs/concepts/overview/prisma-in-your-stack/is-prisma-an-orm>`__ for Node.js and Typescript that fundamentally differs from traditional ORMs. With Prisma, you define your models in the declarative `Prisma schema <https://www.prisma.io/docs/concepts/components/prisma-schema>`__, which serves as the single source of truth for your database schema and the models in your programming language. The Prisma Client will read and write data to your database in a type-safe manner, without the overhead of managing complex model instances. This makes the process of querying data a lot more natural as well as more predictable since Prisma Client always returns plain JavaScript objects.
126
+
See the `Mongoose documentation <https://mongoosejs.com/>`__ or `MongoDB &
Support for MongoDB was one of the most requested features since the initial release of the Prisma ORM, and was added in version 3.12.
131
+
Prisma
132
+
~~~~~~
133
+
134
+
Prisma is a third-party ODM for Node.js and Typescript that fundamentally differs from
135
+
traditional ORMs. It uses declarative Prisma schemas as the single
136
+
source of truth for both your database schema and models. The Prisma client
137
+
reads and writes data in a type-safe manner, and returns plain JavaScript objects.
81
138
82
139
See `Prisma & MongoDB <https://www.prisma.io/mongodb>`__ for more information.
83
140
84
-
## Spring Data MongoDB
141
+
PHP
142
+
---
143
+
144
+
Doctrine
145
+
~~~~~~~~
85
146
86
-
If you’re seeking a Java ORM for MongoDB, Spring Data for MongoDB is the most popular choice for Java developers. The `Spring Data <https://spring.io/projects/spring-data>`__ project provides a familiar and consistent Spring-based programming model for new datastores while retaining store-specific features and capabilities.
147
+
Doctrine is a third-party PHP MongoDB ODM. This library provides PHP object mapping
148
+
functionality and transparent persistence for PHP objects to MongoDB, as well as
149
+
a mechanism to map embedded or referenced documents. It can also create
150
+
references between PHP documents in different databases and work with `GridFS
Key functional areas of Spring Data MongoDB that Java developers will benefit from are a POJO centric model for interacting with a MongoDB DBCollection and easily writing a repository-style data access layer.
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.
157
+
Symfony
158
+
````````
91
159
92
-
## Entity Framework Core
160
+
The Doctrine MongoDB ODM can be used to integrate MongoDB with
161
+
the Symfony PHP framework. Doctine's object mapping enables developers to get
162
+
the benefits of MongoDB features, such as flexible schema design
163
+
and advanced searches, alongside Symfony's reusable components and streamlined
164
+
web design.
93
165
94
-
`Entity Framework Core <https://learn.microsoft.com/en-us/ef/>`__ is the most popular ORM/ODM in the .NET ecosystem. The official MongoDB Provider for EF Core allows developers to confidently use C# and EF Core when building with MongoDB for production-grade workloads. With the MongoDB Provider for EF Core, C# developers can unlock the full power of MongoDB's developer data platform to build modern applications while leveraging a familiar API interface, query paradigm (LINQ), and design patterns.
166
+
See the `Symfony MongoDB Integration page
167
+
<https://www.mongodb.com/docs/drivers/php-frameworks/symfony/>`__ for more
168
+
information.
95
169
96
-
See the `EF Core provider documentation <https://www.mongodb.com/docs/entity-framework/current/>`__ for more information.
170
+
.. TODO? Drupal
97
171
98
-
## Laravel
172
+
Laravel
173
+
-------
99
174
100
-
Laravel MongoDB is an official package that offers seamless integration of
101
-
MongoDB with the Laravel framework. It enables developers to utilize the full
102
-
suite of Laravel's powerful Eloquent features when working with MongoDB. With
103
-
this package, Laravel developers can take advantage of MongoDB's flexible schema
175
+
Laravel MongoDB is the official integration for MongoDB and Laravel. It extends
176
+
methods in the PHP Laravel API to provide developers the full suite of Laravel's
177
+
Eloquent and Query Builder features while using MongoDB as their datastore.
178
+
With this package, Laravel developers can take advantage of MongoDB's flexible schema
104
179
and extensive capabilities, while maintaining familiar patterns, relationships,
Doctrine MongoDB ODM, which is an Object-Document Mapper (ODM) for MongoDB and
114
-
PHP, provides a way to work with MongoDB in Symfony, using the same principles
115
-
as Doctrine ORM for relational databases. Doctrine ODM allows you to map PHP
116
-
objects to MongoDB documents and query MongoDB by using a builder API. This
117
-
mapping enables you to use other MongoDB features such as flexible schema design
118
-
and advanced searches. Refer to the `Symfony MongoDB Integration page
119
-
<https://www.mongodb.com/docs/drivers/php-frameworks/symfony/>`__ to learn more.
182
+
See the `Laravel MongoDB documentation
183
+
<https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current/>`__ for more
184
+
information.
120
185
121
-
## Django
186
+
Django
187
+
------
122
188
123
-
Django-MongoDB-Backend is the official MongoDB integration for Django, enabling seamless compatibility between Django and MongoDB. This integration supports many core Django features, including Models, Authentication, the Admin Panel, and, most notably, the Django ORM. It allows developers to use Django ORM methods, which are directly translated into equivalent MongoDB queries.
189
+
Django MongoDB Backend is the official MongoDB integration for Django and
190
+
MongoDB. This integration supports many core Django features, including the
191
+
Django ORM. It translates Django ORM methods into equivalent MongoDB queries,
192
+
allowing developers to use the familiar Django interface.
124
193
125
-
The library is currently in public preview, meaning developers can explore its
126
-
capabilities, provide feedback, and request new features. However, it is not yet
127
-
recommended for production use. To learn more, visit our `documentation
0 commit comments