Update JSON using jsonPath

I have no trouble getting a value using jsonPath:
var obj = S(json string);
var field = obj.jsonPath(path string);
print(field.value());

However, I want to set the value using the path string. I’m sure this must be possible, but I can’t find a way to do it.

Well - apparently the Jackson tree nodes are immutable. I poked around looking for a ‘parent’ method (have the parent delete the old node then add the new node), but got wrapped around the axle before I found how to get from the Spin nodes to something that let me find the parent. Anyways, I ended up writing my own function rather than using jsonPath.