[Home] [By Thread] [By Date] [Recent Entries]
Hi Mike,
> Once you have this basic support at the data structure level, you probably need to introduce operations that take advantage of it: rather like map:put which creates a new map as a modified copy of an existing map, with a delta implementation underneath, you need operations that create a new tree which is a delta copy of an existing tree differing only in small details, e.g. a change in the value of a single attribute.
Syntactically, this would be very similar to a copy-modify-return with an update expression. This functionality is actually supported by JSONiq with a syntax similar to the Update Facility -- but on JSON trees (where there are no parent pointers in the JDM design).
With Zorba 3.0:
__
jsoniq version "1.0";
let $a := {
"foo" : 1,
"bar" : [
{ "foobar" : 2 },
{ "foobar" : 5 }
]
}
return
copy $b := $a
modify replace value of json $b.bar[[1]].foobar with 3
return $b
__
Kind regards,
Ghislain
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



