Boolean values are expressed as true and false as json.
Examples:
import jsonpath_rw_ext
data = [{"color": "blue", "flag": True}, {"color": "green", "flag": False}]
jsp = jsonpath_rw_ext.parse("$[?flag = true].color")
print [match.value for match in jsp.find(data)]
# prints ['blue']
jsp = jsonpath_rw_ext.parse("$[?flag = false].color")
print [match.value for match in jsp.find(data)]
# prints ['green']
Strings "true" and "false" can still be matched using quotes.
Filtering with boolean values now supported.
Boolean values are expressed as
true
andfalse
as json.Examples:
Strings
"true"
and"false"
can still be matched using quotes.Closes #10 .