Closed bitsofinfo closed 5 years ago
Answered my own question
>>> result = tree.execute("$.b[0].animals[split(@.id,' ')[0] is 'test']")
>>> next(result)
{'id': 'test AA1', 'value': 'something'}
>>> next(result)
{'id': 'test AA2', 'value': 'whatever'}
works!
Hi, cool library!
I have a scenario where I want to get all of the "animals" below where the
id
attribute contains the word test.How can I do this? Nothing below seems to work. I can get them explicitly as below, but not from a match this prefix kind of way. The
in
andis
comparison operators seems like they should work, but it doesn't appear to.There seems to be no way to utilize the
in
oris
syntax in this way? Perhaps I am doing it wrong?