dls.documentSetProperties( uri as String, properties as Node[] ) as null
This function sets the properties of a document to the given
sequence of elements. With the exception of the Library Services properties, any properties
that already exist on the document are replaced.
To preserve existing document properties, use
dls.documentAddProperties
.
Each element QName is the property name and the element value is the property value.
Note that properties are not maintained in version history.
Parameters | |
---|---|
uri | The URI of the document. |
properties | The properties to be set for the document. |
dls-user
role is required to run
this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
Modifying properties requires update permissions on a document.
// The 'priority' and 'status' properties are set to the 'baz.xml' document. const dls = require('/MarkLogic/dls'); declareUpdate(); const properties = [ new NodeBuilder().addElement('priority', '1').toNode(), new NodeBuilder().addElement('status', 'unedited').toNode()]; dls.documentAddProperties('/foo/bar/baz.xml', properties);