jmespath / jmespath/jmespath.site

filter on key containing special character

Open
#42 0 comments 1 reaction 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.