dls.documentSetProperty( uri as String, property as Node ) as null
This function sets a property on a document. If any properties with the same property QName exist, they are replaced with the new property. If no properties exist with the same QName, the new property is added.
Parameters | |
---|---|
uri | The URI of the document. |
property | The property to set. |
dls-user
role is required to run
this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
// The 'priority' property is set to the 'foo/bar/baz.xml' document. const dls = require('/MarkLogic/dls'); declareUpdate(); const properties = [ new NodeBuilder().addElement('priority', '1').toNode()]; dls.documentAddProperties('/foo/bar/baz.xml', properties);