-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Enhance @DocumentReference
to allow one-to-many style lookups
#3798
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
Comments
@caspian-borison-by thanks for the suggestion! Turns out with a few bits changed this can be done (#3802). |
Awesome! I can definitely see the self reference being useful. |
@DocumentReference
to allow one-to-many style lookups
Hi can you explain me MongoTemplateDocumentReferenceTests Test - allowsOneToMayStyleLookupsUsingSelfVariable works fine But if I rewrite it. It doesn't pass... =(
|
This is an amazing new feature and I definitely am looking forward to using it when 2.6 is released.
However, I have been playing around with it in some sandbox projects and (perhaps there is something I am missing, the documentation doesn't seem to address it?) but there appears to be one specific functional gap in the usage of it.
Assume I have:
Is it at all possible for the list of books to do a db.books.find({'publisherId': Publisher::id}) without storing a List bookIds on the Publisher class? Perhaps I am missing something from the documentation and this is already supported?
If not, then (I realize we're starting to get into foreign key relationships with Mongo which isn't the greatest thing), it does seem like a use case that would be beneficial to support if possible?
Thanks!
The text was updated successfully, but these errors were encountered: