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

Issues with $let since 6.2.0 #302

Closed
abarthen opened this issue Jan 12, 2023 · 1 comment
Closed

Issues with $let since 6.2.0 #302

abarthen opened this issue Jan 12, 2023 · 1 comment
Labels

Comments

@abarthen
Copy link

abarthen commented Jan 12, 2023

When trying to upgrade from 6.1.3 I am experiencing issues with queries that should work. $let seems to be one source of this, though apparently not the only one - replacing the 6.2.X version of $let with the 6.1.3 version prevents the query from crashing but the result is still wrong.

I have this example query which works in the mongo playground and also worked prior to 6.2.0:
https://mongoplayground.net/p/Yf2QrwCX7Sf

If I log what let.js does I get {e: "t"} as variables, which makes sense since the first element in the list I check is the string "string", so the element at index 1 is "t". But I then get the error Use of undefined variable: e and execution stops.

Using the code from 6.1.3 for $let fixes this and the result of $let is correct but the endresult is still wrong (no element gets returned), so there are apparently more issues elsewhere.

@kofrasa kofrasa added the bug label Jan 12, 2023
@kofrasa
Copy link
Owner

kofrasa commented Jan 12, 2023

Thanks for the report @abarthen. I think it was introduced in the refactor to separate variables from the actual document for processing.

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

No branches or pull requests

2 participants