tidwall / gjson

Get JSON values quickly - JSON parser for Go
MIT License
13.88k stars 841 forks source link

How to get all the keys and values ​​of json through wildcards #353

Open Chaofan34 opened 3 months ago

Chaofan34 commented 3 months ago

example i want to use gjson.Get(jsonStr, "prefix_*"), get the value from prefix_a and prefix_b, but only get result {"a":"1"}

{
  "prefix_a": {"a": "1"},
  "prefix_b": {"b": "2"}
}
jiyoontbd commented 2 months ago

have you tried using the GetMany function? looks like it should do what you want.