Product SiteDocumentation Site

7.2.4. Replacing expressions

            JSONReplaceExpr ::= "replace" "json" "value" "of" PrimaryExpr ( "(" ExprSingle ")" )+ "with" ExprSingle
PrimaryExpr followed by all "(" ExprSingle ")" except the last one, is evaluated according to the semantics of dynamic function calls. It must return a single object $o or a single array $a. Otherwise, jerr:JNUP0008 is raised. After this evaluation, two cases can appear for interpreting the last "(" ExprSingle ")":
(for explanatory purposes, suboperands are replaced with a variable containing the result of their evaluation)
Example 7.4. Replace a value in an object or in an array
              replace json value of $o("foo") with 5
              replace json value of $a(3) with 25