@@ -23,30 +23,30 @@ Overview
23
23
In this guide, you can learn how to use {+django-odm+} to run
24
24
raw queries on your MongoDB database. Raw queries allow you to
25
25
query the database by using MongoDB's aggregation pipeline syntax
26
- rather than Django methods. You can also run queries directly
26
+ rather than {+framework+} methods. You can also run queries directly
27
27
on your ``MongoClient`` object for expanded access to your MongoDB data.
28
28
29
29
Query API
30
30
~~~~~~~~~
31
31
32
- The Django ``QuerySet`` API provides a ``raw()`` method, which allows
32
+ The {+framework+} ``QuerySet`` API provides a ``raw()`` method, which allows
33
33
you to perform raw SQL queries on relational databases. However, {+django-odm+}
34
34
does not support the ``raw()`` method. Instead, the ODM provides the
35
35
``raw_aggregate()`` method, which you can use to send instructions
36
36
to the database in pipeline stages.
37
37
38
38
.. note::
39
39
40
- Django provides a ``QuerySet.aggregate()`` method, which differs from the
40
+ {+framework+} provides a ``QuerySet.aggregate()`` method, which differs from the
41
41
``QuerySet.raw_aggregate()`` method. You can use ``aggregate()`` to retrieve
42
42
values by aggregating a collection of model objects. To learn more about
43
43
the ``aggregate()`` method, see `Aggregation <{+django-docs+}/topics/db/aggregation/>`__
44
- in the Django documentation.
44
+ in the {+framework+} documentation.
45
45
46
46
You can run database queries by calling ``QuerySet`` methods on your model's
47
47
``Manager``. The ``Manager`` class handles database operations and allows you
48
- to interact with your MongoDB data by referencing Django models. By default,
49
- Django adds a ``Manager`` named ``objects`` to every model class. This default
48
+ to interact with your MongoDB data by referencing {+framework+} models. By default,
49
+ {+framework+} adds a ``Manager`` named ``objects`` to every model class. This default
50
50
``Manager`` does not support the ``raw_aggregate()`` method. To use this
51
51
MongoDB-specific method, set your model's ``objects`` field to a custom
52
52
manager called ``MongoManager``.
@@ -57,7 +57,7 @@ Sample Data
57
57
The examples in this guide use the ``Movie`` and ``Theater`` models, which
58
58
represent collections in the ``sample_mflix`` database from the :atlas:`Atlas sample datasets </sample-data>`.
59
59
These models explicitly set the ``objects`` field to use a custom ``MongoManager``,
60
- rather than Django 's default ``Manager`` class. The model classes have the following
60
+ rather than {+framework+} 's default ``Manager`` class. The model classes have the following
61
61
definitions:
62
62
63
63
.. literalinclude:: /includes/interact-data/raw-queries.py
0 commit comments