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

[QA] Nested [ is officially support? #507

Closed
fredppm opened this issue Mar 22, 2021 · 2 comments
Closed

[QA] Nested [ is officially support? #507

fredppm opened this issue Mar 22, 2021 · 2 comments

Comments

@fredppm
Copy link

fredppm commented Mar 22, 2021

Hello

I was trying to figure out if the nested brackets is officially support or may be a bug feature.

My may sample

I want to sum all values from the array of objects named totals and filter it when only this object has the Id with CustomTax or Tax
So this query works for me
(totals[id in ["CustomTax", "Tax"]].value ? $number($sum(totals[id in ["CustomTax", "Tax"]].value)) : undefined)

But using the try page the syntax highlight appear to be bugged
image

I didn't find any warnings in the docs about this nested operations so I want just to confirm if the query interpretation officially handling this inception .
Thank

@markmelville
Copy link
Contributor

markmelville commented Mar 25, 2021

That expression has no syntax errors for me in the exerciser (i.e. the try page).

BTW, this expression is effectively the same (I'm not sure of your input data):

$sum(totals[id in ["CustomTax", "Tax"]].value)

@andrew-coleman
Copy link
Member

I suspect @fredppm doesn't like the colours in the exerciser.
There is an issue open for this: jsonata-js/jsonata-exerciser#18
Closing this one.

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

No branches or pull requests

3 participants