jmespath / jmespath/jmespath.site
filter on key containing special character
- Dominant language
- Makefile
- Stars
- 61
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Description
#### Data Structure
```
{
"objects": [
{
"@TYPE": A,
"$": "one",
},
{
"@TYPE": B,
"$": "two",
},
{
"@TYPE": C,
"$": "three",
}
]
}
```
#### Question
I am trying to write a query that will return `"one"`. I have tried the following:
`objects[?@TYPE == "A"]."$"` this is a syntax error
`objects[?"@TYPE" == "A"]."$" ` this returns an empty array
`objects[?"\@TYPE" == "A"]."$"` this is a syntax error
`objects[?"/@TYPE" == "A"]."$"` this returns `["one", "two", "three"]` which is a surprise...
What is the proper way to escape the `@` in the key name?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.