tidwall / gjson

Get JSON values quickly - JSON parser for Go
MIT License
14.31k stars 854 forks source link

Query syntax - is #(...) really supported #202

Closed shmul closed 3 years ago

shmul commented 3 years ago

Hi,

I tried using the #(...) query syntax as document but it doesn't work for me (version v1.6.7). The older #[..] syntax does work but you mentioned it will be deprecated. Is the new one already supported? These are the examples from running my tests (using gjson.GetManyBytes on the documentation example json)

friends.#[last=="Murphy"]#.first
[["James"]]

friends.#(last=="Murphy")#.first
[]

Am I missing something?

Cheers, Shmul

tidwall commented 3 years ago

Yes. It works.

shmul commented 3 years ago

Thanks for the prompt response. Indeed it does - https://play.golang.org/p/F41yssCMxcU . Sorry. I can swear it didn't work for me earlier 🤷‍♂️ . Thanks anyway