PatchBuilderPlan.prototype.insertChild( path as String, content as Node ) as PatchBuilderPlan
Insert a node as child.
Parameters | |
---|---|
path | The path to insert the child. |
content | The new content. |
'use strict'; declareUpdate(); const op = require('/MarkLogic/optic'); const docDescriptors = [{uri: '/optic/update/write4.xml',doc:xdmp.unquote("<doc><action>write4</action></doc>")}, {uri: '/optic/update/write5.xml',doc:xdmp.unquote("<doc><action>write4</action></doc>")}] op.fromDocDescriptors(docDescriptors) .patch(op.col('doc'), op.patchBuilder('/doc',null) .insertChild("action",xdmp.unquote("<subaction>write</subaction>")) ) .write() .result();