Skip to content
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

do not use $lookup for query with variables if only single variable set #147

Draft
wants to merge 10 commits into
base: v1
Choose a base branch
from

Conversation

hallettj
Copy link
Collaborator

This allows a $vectorSearch to be the target of a remote join if the join forwards exactly one variable set.

@hallettj hallettj self-assigned this Feb 26, 2025
@hallettj hallettj marked this pull request as draft February 27, 2025 20:51
@hallettj
Copy link
Collaborator Author

In addition to MongoDB Atlas not allowing $vectorSearch in sub-pipelines it looks like $vectorSearch does not substitute variable references in its arguments. So even after I added a workaround for the sub-pipeline issue yesterday the remote join use case still didn't work. In particular we had a problem with the queryVector argument.

There is a way to fix the variable issue with some more work: in the case of a query request with exactly one variable set rewrite the request to inline all variable values. That's another way to get the sub-pipeline workaround so it would replace the changes currently in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant