0
对于XQuery和MarkLogic来说很新颖,以下语句的XQuery版本是什么?如何在使用XQuery时将一个字段的值设置为另一个字段
update all_the_records
set B_field = A_field
where B_field is null and A_field is not null
对于XQuery和MarkLogic来说很新颖,以下语句的XQuery版本是什么?如何在使用XQuery时将一个字段的值设置为另一个字段
update all_the_records
set B_field = A_field
where B_field is null and A_field is not null
这样的事情可能会让你开始。但请记住,您正在使用树木,而不是桌子。由于额外的维度,事情通常更加复杂。
for $doc in collection()/doc[not(b)][a]
let $a as element() := $doc/a
return xdmp:node-insert-child($doc, element b { $a/@*, $a/node() })
最后我做它像这样实际上,我的假设是存在的两个节点 节点替换($ BTAG, $ A /文() ) –
nightograph
2014-12-09 22:23:14