@@ -168,9 +168,10 @@ The following table describes supported BSON field types and their
168168 in this guide.
169169
170170 * - ``Object``
171- - ``EmbeddedModelField``
172- - | Stores embedded documents. To learn more about using this field
173- with {+django-odm+}, see the :ref:`django-models-embedded` section in this guide.
171+ - ``EmbeddedModelField`` or ``EmbeddedModelArrayField``
172+ - | Stores one or multiple embedded documents. To learn more about using these fields
173+ with {+django-odm+}, see the :ref:`django-models-embedded` and :ref:`django-models-embedded-array`
174+ sections.
174175
175176 * - ``ObjectId``
176177 - ``ObjectIdField``
@@ -452,6 +453,36 @@ and modifies the ``Movie`` model to include the ``EmbeddedModelField``:
452453 To learn how to query data stored in an ``EmbeddedModelField``, see
453454 :ref:`django-query-embedded` in the Specify a Query guide.
454455
456+ .. _django-models-embedded-array:
457+
458+ Use an EmbeddedModelArrayField
459+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
460+
461+ You can use an ``EmbeddedModelArrayField`` to represent a MongoDB document
462+ field that stores an array of documents in a one-to-many relationship. Each
463+ document in the array corresponds to a {+django-odm+} ``EmbeddedModelField`` value. To create an ``EmbeddedModelArrayField``,
464+ use the ``EmbeddedModelArrayField()`` class constructor and pass the following arguments:
465+
466+ - ``embedded_model``: Specifies the model stored in each array item.
467+
468+ - ``max_size``: *(Optional)* Specifies the maximum size of the array.
469+
470+ Example
471+ ```````
472+
473+ This example adds an ``EmbeddedModelArrayField`` value to the model created in
474+ the :ref:`Define a Model example <django-models-define-ex>` in this
475+ guide. This ``cast`` field stores an array of embedded ``Actor`` models.
476+ The following code defines the ``Actor`` model and modifies the ``Movie`` model
477+ to include the ``EmbeddedModelArrayField``:
478+
479+ .. literalinclude:: /includes/model-data/models.py
480+ :start-after: start-embedded-array-field
481+ :end-before: end-embedded-array-field
482+ :language: python
483+ :copyable:
484+ :emphasize-lines: 5, 15
485+
455486Additional Information
456487----------------------
457488
0 commit comments