Skip to content

Commit

Permalink
edits
Browse files Browse the repository at this point in the history
  • Loading branch information
timgraham committed Feb 14, 2025
1 parent a41d3e4 commit 1986472
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 25 deletions.
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"https://docs.djangoproject.com/en/5.1/",
"https://docs.djangoproject.com/en/5.1/_objects/",
),
"mongodb": ("https://www.mongodb.com/docs/languages/python/django-mongodb/v5.1/", None),
"pymongo": ("https://pymongo.readthedocs.io/en/stable/", None),
"python": ("https://docs.python.org/3/", None),
}
Expand Down
6 changes: 4 additions & 2 deletions docs/source/intro/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ For a localhost configuration, you can omit :setting:`HOST` or specify
:setting:`OPTIONS` is an optional dictionary of parameters that will be passed
to :class:`~pymongo.mongo_client.MongoClient`.

:setting:`USER`, :setting:`PASSWORD`, and :setting:`PORT` (if 27017) may also
be optional.
Specify :setting:`USER` and :setting:`PASSWORD` if your database requires
authentication.

:setting:`PORT` is optional if unchanged from MongoDB's default of 27017.

For a replica set or sharded cluster where you have multiple hosts, include
all of them in :setting:`HOST`, e.g.
Expand Down
11 changes: 8 additions & 3 deletions docs/source/intro/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ to quickly get up and running.
.. seealso::

If you're new to Django_, you might want to start by getting an idea of
what it's like. The :doc:`official Django tutorial
<django:intro/tutorial01>` is a great place to start. Once you understand
some Django basics, come back here and learn how to use it with MongoDB.
what it's like.

For a tutorial that covers using this library with MongoDB Atlas (a fully
managed cloud database service that hosts MongoDB), read
:doc:`mongodb:get-started`.

Another excellent tutorial that covers Django in more detail is the
:doc:`official Django tutorial <django:intro/tutorial01>`.

.. _Django: https://www.djangoproject.org/
50 changes: 30 additions & 20 deletions docs/source/topics/known-issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ Known issues and limitations
============================

This document summarizes some known issues and limitations of this library.
If you notice an issue not listed, use the :ref:`issue-tracker` to report a bug
or request a feature.

Like any database, MongoDB has some particularities. Also keep in mind that
because MongoDB is a NoSQL database, it's impossible to implement SQL-specific
Expand All @@ -16,6 +18,13 @@ Model fields
:class:`~django.db.models.DurationField` stores milliseconds rather than
microseconds.

- Some of Django's built-in fields aren't supported by MongoDB:

- :class:`~django.db.models.AutoField` (including
:class:`~django.db.models.BigAutoField` and
:class:`~django.db.models.SmallAutoField`)
- :class:`~django.db.models.GeneratedField`

Querying
========

Expand Down Expand Up @@ -47,23 +56,24 @@ Querying
Database functions
==================

- The following database functions aren't supported:
- :class:`~django.db.models.functions.Chr`
- :class:`~django.db.models.functions.ExtractQuarter`
- :class:`~django.db.models.functions.LPad`,
:class:`~django.db.models.functions.RPad`
- :class:`~django.db.models.functions.MD5`
- :class:`~django.db.models.functions.Now`
- :class:`~django.db.models.functions.Ord`
- :class:`~django.db.models.functions.Repeat`
- :class:`~django.db.models.functions.Reverse`
- :class:`~django.db.models.functions.Right`
- :class:`~django.db.models.functions.SHA1`,
:class:`~django.db.models.functions.SHA224`,
:class:`~django.db.models.functions.SHA256`,
:class:`~django.db.models.functions.SHA384`,
:class:`~django.db.models.functions.SHA512`
- :class:`~django.db.models.functions.Sign`
- Some of Django's built-in database functions aren't supported by MongoDB:

- :class:`~django.db.models.functions.Chr`
- :class:`~django.db.models.functions.ExtractQuarter`
- :class:`~django.db.models.functions.LPad`,
:class:`~django.db.models.functions.RPad`
- :class:`~django.db.models.functions.MD5`
- :class:`~django.db.models.functions.Now`
- :class:`~django.db.models.functions.Ord`
- :class:`~django.db.models.functions.Repeat`
- :class:`~django.db.models.functions.Reverse`
- :class:`~django.db.models.functions.Right`
- :class:`~django.db.models.functions.SHA1`,
:class:`~django.db.models.functions.SHA224`,
:class:`~django.db.models.functions.SHA256`,
:class:`~django.db.models.functions.SHA384`,
:class:`~django.db.models.functions.SHA512`
- :class:`~django.db.models.functions.Sign`

- The ``tzinfo`` parameter of the :class:`~django.db.models.functions.Trunc`
database functions doesn't work properly because MongoDB converts the result
Expand All @@ -87,6 +97,6 @@ Due to the lack of ability to introspect MongoDB collection schema,
Caching
=======

:ref:`Database caching <database-caching>` is not supported since the built-in database cache backend
requires SQL. A custom cache backend for MongoDB will be provided in the
future.
:ref:`Database caching <database-caching>` is not supported since the built-in
database cache backend requires SQL. A custom cache backend for MongoDB will be
provided in the future.

0 comments on commit 1986472

Please sign in to comment.