-
-
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
storeAs option for references #1349
storeAs option for references #1349
Conversation
/**#@+ | ||
* The types of storeAs references | ||
* | ||
* TODO move this to a different class? |
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.
I think it's a good place 👍
Thanks for getting started with this, this should clean up reference mapping a bit! I know I'm the one to come up with "partial" and "full", but I've "seen some things" that make me want to change the naming to include "dbref" in the name, especially since that's the name of the structure we're actually storing. Likewise, we could rename the "simple" option to "id" as a reference of that type would only store the ID of the reference object, not a DBRef object. I'm really looking forward to this 👍 |
I'm not sure if we should include the dbRef name, because the "simple" option would not use the the DBRef structure. The 'simple' vs 'id' argument I can follow. |
@coudenysj the "simple" option does not store it as DBRef and thus doesn't have "dbref" in its name. If we store it as "dbref" we might as well rename the storage option to include "dbref" in the name ;) |
@alcaeus Are you talking about the "storeAs" name? Or the different values it can have? |
Sorry, I was talking about the values it can have. IMO, "dbref" is more descriptive than "full" - same goes for partial as it's actually a partial dbref object (still dislike the wording "partial" in there, don't have an alternative though) |
Gotta love naming things |
So you want to make the values really descriptive. Some more brain dumps:
|
@coudenysj what's the state of this? I could use some of this stuff for some sharding magic in references but want to hold off until we're done changing the whole simple vs. full thing. Any progress you can report? |
Hi @alcaeus, no further progress on this. If we can agree upon naming, I can do some more programming to finalize this. |
Right. How about |
I can live with that :). Let's see if I can work on it. |
Owkay, so I've added the option to all drivers and scanned the code for the "simple" reference. Is it the correct approach if I try to "redirect" the "simple" option to the "storeAs: id" option, and refactor all the "simple" checks? |
I think we should keep it |
I will try to support both ( |
dc3b386
to
7ccc6bf
Compare
If this TravisCI check comes back positive, I think this pull request is ready. |
@@ -314,6 +314,8 @@ a certain class, you can optionally specify a default discriminator value: | |||
Simple References | |||
----------------- | |||
|
|||
TODO: Rewrite this to reflect the new ``storeAs`` approach. |
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.
Commenting on this so we don't forget to revisit before merging
#1406 has been merged into 1.0.x and master - you can rebase this PR and update the fix. |
… the deprecated "simple" key
…rds compatibility
…maManagerTest::testEnsureIndexes
…upport the "storeAs" method
916cb66
to
191c63f
Compare
Processed changes from #1406, so this PR is ready for final review. |
|
||
.. note:: | ||
|
||
The ``storeAs=id`` option used to call a "simple reference". The old syntax is |
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.
"used to be called"
LGTM, thanks @coudenysj for working on this! |
Thank you @coudenysj! |
As discusses in #807, this pull requests starts using a
storeAs
option to support different storage formats:simple
: $idpartial
: $id, $reffull
: $id, $ref, $dbWith
full
being the default.