From bffe0587264e0f3897427be95d10642e530e9fbe Mon Sep 17 00:00:00 2001 From: Jan-Lucas Ott Date: Wed, 30 Jun 2021 17:16:07 -0400 Subject: [PATCH] Mention DynamicEmbeddedDocument in embedded section. --- docs/guide/defining-documents.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/guide/defining-documents.rst b/docs/guide/defining-documents.rst index e16c5bc4..eff59845 100644 --- a/docs/guide/defining-documents.rst +++ b/docs/guide/defining-documents.rst @@ -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 @@ -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