tidwall / sjson

Set JSON values very quickly in Go
MIT License
2.4k stars 165 forks source link

Allow modification based on specified path #42

Open pal-saurabh opened 3 years ago

pal-saurabh commented 3 years ago

trying to give an example. In an array of objects, can we have support for updating one object based on specifying attribute and value of individual object in the array.

{ "attrs": [{ "name": "location", "value": "Chicago" }, { "name": "address", "value": "Magnificent Mile" }, { "name": "count", "value": "50" }] }

value, _ := sjson.Set("attrs#(name=="location")", "Lewisville")

tidwall commented 3 years ago

Unfortunately, this feature is currently not available.