Open volans- opened 2 years ago
It probably should be documented, but you need to escape the path.
#(a\!\=e>15)# -> [{"a!=e": 20}]
@tidwall Got it, thanks for the explanation. I was also surprised that escaping other characters has no effects. For example #(\a\!\=e>15)#
does work too.
It probably should be documented, but you need to escape the path.
#(a\!\=e>15)# -> [{"a!=e": 20}]
Actually it is documented in (SYNTAX.md). Maybe a short note on escaping should be added to the README.md too
@lammel thanks, I had actually read the paragraph of the documentation that you linked above, but because it's right underneath the Wildcards
section and it mentions the same specific characters, I had interpreted it as referring exclusively to those three characters. But I see now that reading it in isolation it can also be read as a more generic escaping method.
Maybe making that a bit more explicit in the docs could avoid any misinterpretation.
Given the following JSON:
It seems to not be possible to query for say all items with the value of
"a!=e"
greater than 15. Things I've tried:#(a!=e>15)#
->[]
#("a!=e">15)#
->[]
The workaround I found is to use wildcards (
#(a??e>15)#
), but wildcards might not allow to solve all possible scenarios. If this is an intended limitation maybe it should be mentioned in the readme/syntax page.