Skip to content

Commit

Permalink
Merge pull request #2536 from ottj3/patch-1
Browse files Browse the repository at this point in the history
Mention DynamicEmbeddedDocument in usage docs.
  • Loading branch information
bagerard committed Jul 2, 2021
2 parents 4670508 + bffe058 commit 3b10236
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/guide/defining-documents.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ objects** as class attributes to the document class::
As BSON (the binary format for storing data in mongodb) is order dependent,
documents are serialized based on their field order.

.. _dynamic-document-schemas:

Dynamic document schemas
========================
One of the benefits of MongoDB is dynamic schemas for a collection, whilst data
Expand Down Expand Up @@ -231,6 +233,9 @@ document class as the first argument::
comment2 = Comment(content='Nice article!')
page = Page(comments=[comment1, comment2])

Embedded documents can also leverage the flexibility of :ref:`dynamic-document-schemas:`
by inheriting :class:`~mongoengine.DynamicEmbeddedDocument`.

Dictionary Fields
-----------------
Often, an embedded document may be used instead of a dictionary – generally
Expand Down

0 comments on commit 3b10236

Please sign in to comment.