-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
CSHARP-5396: Add support for arbitrary join inner expression arguments in LINQ #1531
base: main
Are you sure you want to change the base?
Conversation
Even though now it doesn't throw exceptions, Where()'s of foreign collection queryable are ignored. Probably more work is needed to get this job done. As I understand, in JoinMethodToPipelineTranslator.Translate method line 66, innerExpression(foreign queryable expression) is used only for collectionName. So JoinMethodToPipelineTranslator.Translate does not respect the content of innerExpression. |
You are correct, we expect the
and not:
This is by design. I'm not sure how much work it would be, or if it is even possible, to support arbitrary |
Okay. Now, this this is a new feature rather than a bug. I will investigate and try to implement this feature this week. I will update you here. Also, should I update the title and description of this PR and Jira issue? The scope of this PR has changed. |
I implemented this feature and changed content of this PR. fyi @rstam |
} | ||
else | ||
{ | ||
var lookupPipeline = ExpressionToPipelineTranslator.Translate(context, innerExpression); |
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 create a new TranslationContext for innerExpression?
This PR add support for arbitrary join inner expression arguments in LINQ.
Problem
The MongoDB LINQ translator currently throws an exception when attempting to join a foreign collection queryable that includes additional query operations (like
.Where()
).Example of the Issue
When trying to join two collections with filtering conditions, the following code throws an exception:
The code only works if you remove the
.Where()
clause frompageContainers
. This PR adds support for such filtering operations on joined collections.Current Error
Without this PR, the above code throws the following exception:
Todos