From b3ce65453aef5e63668ec62a57b37f9ef3b340c3 Mon Sep 17 00:00:00 2001 From: Bastien Gerard Date: Mon, 8 Mar 2021 22:21:48 +0100 Subject: [PATCH] Fix one-to-many example that is actually a many to many --- docs/guide/defining-documents.rst | 6 +++--- mongoengine/fields.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guide/defining-documents.rst b/docs/guide/defining-documents.rst index ed092907..a457de1f 100644 --- a/docs/guide/defining-documents.rst +++ b/docs/guide/defining-documents.rst @@ -290,12 +290,12 @@ as the constructor's argument:: content = StringField() -.. _one-to-many-with-listfields: +.. _many-to-many-with-listfields: -One to Many with ListFields +Many to Many with ListFields ''''''''''''''''''''''''''' -If you are implementing a one to many relationship via a list of references, +If you are implementing a many to many relationship via a list of references, then the references are stored as DBRefs and to query you need to pass an instance of the object to the query:: diff --git a/mongoengine/fields.py b/mongoengine/fields.py index e714dde9..276b02ce 100644 --- a/mongoengine/fields.py +++ b/mongoengine/fields.py @@ -915,7 +915,7 @@ class ListField(ComplexBaseField): """A list field that wraps a standard field, allowing multiple instances of the field to be used as a list in the database. - If using with ReferenceFields see: :ref:`one-to-many-with-listfields` + If using with ReferenceFields see: :ref:`many-to-many-with-listfields` .. note:: Required means it cannot be empty - as the default for ListFields is []