-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Store redundant fields in references #1527
Conversation
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.
Should we limit what can be stored in redundant field? I guess putting there EmbedMany
field will have some side effects depending on it being initialzed or not
Looks cool, putting into 1.2 feature bucket 👍 |
42af3f2
to
41d3234
Compare
Leaving a note to future us:
|
Dot notation would be a bit complicated, since that may trigger a whole bunch of database loads. There's already a potential database load involved when building a DBRef object (e.g. when the referenced document is not initialized and redundant fields are defined). This happens even when the DBRef object is not used for writing, but only for reading (e.g. by being called in |
Closing as the PR is horribly stale: created #2252 to track this and will try to revisit this for one of the next 2.x releases. |
References in MongoDB can be just IDs for a referenced document, or they can be full-fledged DBRef objects that can contain additional information. We use this functionality to add a discriminator value to properly hydrate a referenced document.
This PR allows developers to store additional fields from a referenced document within the reference, so it can be used in queries. There are two caveats at this time: