marklogic - How to set the value of one field to another filed in using XQuery -


very new xquery , marklogic, xquery version of following statement?

update all_the_records  set b_field = a_field  b_field null , a_field not null 

something might started. remember you're working trees, not tables. things more complicated because of dimension.

for $doc in collection()/doc[not(b)][a] let $a element() := $doc/a return xdmp:node-insert-child($doc, element b { $a/@*, $a/node() }) 

Comments

Popular posts from this blog

javascript - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -