-
Notifications
You must be signed in to change notification settings - Fork 7
DOCSP-50489: EmbeddedModelArrayField support #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOCSP-50489: EmbeddedModelArrayField support #37
Conversation
✅ Deploy Preview for docs-django ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, left a small clarifying comment
source/model-data/models.txt
Outdated
You can use an ``EmbeddedModelArrayField`` to represent a MongoDB ``Object`` | ||
that stores an array of document values. Each document in the array corresponds | ||
to a {+django-odm+} ``EmbeddedModelField`` value. To create an ``EmbeddedModelArrayField``, | ||
use the ``EmbeddedModelArrayField()`` class constructor and pass the following arguments: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
S: there might be confusion between document values and values that are documents
I.e.
- document values of {hello: "world"} -> "world"
- values that are documents - [{hello: "world"}, {goodbye: "sun"}]
You can use an ``EmbeddedModelArrayField`` to represent a MongoDB ``Object`` | |
that stores an array of document values. Each document in the array corresponds | |
to a {+django-odm+} ``EmbeddedModelField`` value. To create an ``EmbeddedModelArrayField``, | |
use the ``EmbeddedModelArrayField()`` class constructor and pass the following arguments: | |
You can use an ``EmbeddedModelArrayField`` to represent a MongoDB ``Object`` | |
that stores an array of documents. Each document in the array corresponds | |
to a {+django-odm+} ``EmbeddedModelField`` value. To create an ``EmbeddedModelArrayField``, | |
use the ``EmbeddedModelArrayField()`` class constructor and pass the following arguments: |
source/model-data/models.txt
Outdated
Use an EmbeddedModelArrayField | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
You can use an ``EmbeddedModelArrayField`` to represent a MongoDB ``Object`` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: In the Mongo parlance, isn't an "object" typically called a "document" and if so an EmbeddedModelArrayField
could also be called a "document of documents" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think document is the better word, changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Just to confirm my understanding,
EmbeddedModelField
can contain a singleEmbeddedModel
instance e.g.Award
and as such, it's similar to a one to one relationship in SQL.EmbeddedModelArrayField
can contain one or moreEmbeddedModel
instances and as such, it's similar to a one to many relationship in SQL.
* DOCSP-50489: EmbeddedModelArrayField support * edit limitations * edits * RR feedback * AC feedback (cherry picked from commit 8a0692b)
Pull Request Info
PR Reviewing Guidelines
JIRA - https://jira.mongodb.org/browse/DOCSP-50489
Staging Links
Self-Review Checklist