-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Incorrect parse result for filters with outer/wrapped brackets #16
Labels
bug
Something isn't working
Comments
18 tasks
naz
referenced
this issue
in naz/Ghost
Jan 21, 2019
closes TryGhost#10395, TryGhost#10390 - The grouping was introduced due to a flasy conjunction of last filter in 'or' group with enforced page filter, due to this the rest of filters in the 'or' group were bypassed - Additional grouping added here increases the possiblity of https://github.com/NexesJS/NQL-Lang/issues/7 bug happening
mike182uk
added a commit
that referenced
this issue
Dec 7, 2023
refs [ARCH-24](https://linear.app/tryghost/issue/ARCH-24/fix-nql-incorrect-parse-result-for-filters-with-outerwrapped-brackets), fixes [#16](#16) With this change, if `yg` is present in the output, it will be removed and its contents will be moved to the parent node
mike182uk
added a commit
that referenced
this issue
Dec 7, 2023
fixes #16 With this change, if `yg` is present in the output, it will be removed and its contents will be moved to the parent node
mike182uk
added a commit
that referenced
this issue
Jan 2, 2024
fixes #16 With this change, if `yg` is present in the output, it will be removed and its contents will be moved to the parent node
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NQL returns a wrong parsed result if filters are wrapped with outer brackets.
Let's assume you pass this filter:
filter=featured:true,(tags:animal+tags:classic)
It results in:
{"$or":[{"featured":true},{"$and":[{"tags":"animal"},{"tags":"classic"}]}]}
Which is correct!
But if you pass a filter like this:
filter=(tags:animal+tags:classic)
It results in:
{"yg":{"$and":[{"tags":"animal"},{"tags":"classic"}]}}
Which is wrong.
Reference:
yg
expression, see.The text was updated successfully, but these errors were encountered: