gjson icon indicating copy to clipboard operation
gjson copied to clipboard

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

Open Chaofan34 opened this issue 1 year ago • 1 comments

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"}
}

Chaofan34 avatar Mar 26 '24 11:03 Chaofan34

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

jiyoonie9 avatar Apr 24 '24 15:04 jiyoonie9