File tree Expand file tree Collapse file tree 3 files changed +50
-8
lines changed Expand file tree Collapse file tree 3 files changed +50
-8
lines changed Original file line number Diff line number Diff line change 17
17
# -- General configuration ---------------------------------------------------
18
18
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
19
19
20
- extensions = []
20
+ # If true, the current module name will be prepended to all description
21
+ # unit titles (such as .. function::).
22
+ add_module_names = False
23
+
24
+ extensions = [
25
+ "sphinx.ext.intersphinx" ,
26
+ ]
21
27
22
28
# templates_path = ["_templates"]
23
29
exclude_patterns = []
24
30
31
+ intersphinx_mapping = {
32
+ "pymongo" : ("https://pymongo.readthedocs.io/en/stable/" , None ),
33
+ "python" : ("https://docs.python.org/3/" , None ),
34
+ "django" : (
35
+ "https://docs.djangoproject.com/en/5.0/" ,
36
+ "http://docs.djangoproject.com/en/5.0/_objects/" ,
37
+ ),
38
+ }
25
39
26
40
# -- Options for HTML output -------------------------------------------------
27
41
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Original file line number Diff line number Diff line change 1
- .. django_mongodb documentation master file, created by
2
- sphinx-quickstart on Mon Apr 15 12:38:26 2024.
3
- You can adapt this file completely to your liking, but it should at least
4
- contain the root ``toctree`` directive.
5
-
6
1
Welcome to django_mongodb's documentation!
7
2
==========================================
8
3
9
4
.. toctree ::
10
- :maxdepth: 2
5
+ :maxdepth: 1
11
6
:caption: Contents:
12
7
13
-
8
+ querysets
14
9
15
10
Indices and tables
16
11
==================
Original file line number Diff line number Diff line change
1
+ ``QuerySet `` API reference
2
+ ==========================
3
+
4
+ Some MongoDB-specific ``QuerySet `` methods are available by adding a custom
5
+ :class: `~django.db.models.Manager `, ``MongoManager ``, to your model::
6
+
7
+ from django.db import models
8
+
9
+ from django_mongodb.managers import MongoManager
10
+
11
+
12
+ class MyModel(models.Model):
13
+ ...
14
+
15
+ objects = MongoManager()
16
+
17
+
18
+ .. currentmodule :: django_mongodb.queryset.MongoQuerySet
19
+
20
+ ``raw_aggregate() ``
21
+ -------------------
22
+
23
+ .. method :: raw_aggregate(pipeline, using=None)
24
+
25
+ Similar to :meth: `QuerySet.raw()<django.db.models.query.QuerySet.raw> `, but
26
+ instead of a raw SQL query, this method accepts a pipeline that will be passed
27
+ to :meth: `pymongo.collection.Collection.aggregate `. The pipeline must return
28
+ the necessary fields to construct model instances and may also return
29
+ additional fields that will be added as annotations on the models.
30
+
31
+ For example, you could write a custom match criteria::
32
+
33
+ Post.objects.raw_aggregate([{"$match": {"title": "MongoDB is fun"}}])
You can’t perform that action at this time.
0 commit comments