Closed ho4040 closed 4 years ago
You have to specify it was a "literal value" (surround it with ` chars) to denote that it's a number type, similar to how you have to use quotes to denote it's a literal string.
$ echo '[
{"name":"goblin", "states":[
{"name":"running", "defense":0},
{"name":"guard", "defense":1}
]},
{"name":"ogre", "states":[
{"name":"running", "defense":1},
{"name":"guard", "defense":2}
]}
]' | jp.py '[].states[] | [?defense > `0`]'
[
{
"name": "guard",
"defense": 1
},
{
"name": "running",
"defense": 1
},
{
"name": "guard",
"defense": 2
}
]
i'm using 0.9.5 version. let's suppose document like below
the query
[].states[] | [?name=='running']
is works fine. but query[].states[] | [?defense>0]
is not working.It shows ParseError.