We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When you use the $filter and it only finds one match, it will return a string rather than an array.
$filter
The documentation states that it should return an array: https://docs.jsonata.org/higher-order-functions#filter
Here is a screenshot of a jsonata excise that shows the issue:
If I invert the expression so that it would return more, it works as expected returning an array.
I'm not sure if this is expected or not, but if it returns nothing, it returns undefined.
The text was updated successfully, but these errors were encountered:
Does this explain what you see? https://docs.jsonata.org/processing#sequences
Rather than paste a screenshot, please could you use the 'save and share' facility and paste in the link.
Sorry, something went wrong.
As discussed in https://docs.jsonata.org/next/construction#array-constructors you can use [ ] to ensure the result is always an array
[ ]
Related #462
No branches or pull requests
Bug
When you use the
$filter
and it only finds one match, it will return a string rather than an array.The documentation states that it should return an array: https://docs.jsonata.org/higher-order-functions#filter
Steps
Here is a screenshot of a jsonata excise that shows the issue:
If I invert the expression so that it would return more, it works as expected returning an array.
I'm not sure if this is expected or not, but if it returns nothing, it returns undefined.
The text was updated successfully, but these errors were encountered: