Loading TOC...

dls.documentAddProperties

dls.documentAddProperties(
   $uri as String,
   $properties as Node[]
) as null

Summary

This function adds the specified properties to any existing properties associated with the named document.

Note that properties are not maintained in version history.

Parameters
$uri The URI of the document.
$properties The properties to add.

Required Privileges

The dls-user role is required to run this function, or the privilege:
http://marklogic.com/xdmp/privileges/dls-user

Usage Notes

You cannot add any property nodes to the DLS namespace.

Example

// The <priority> and <status> properties are added to the 'baz.xml' document.

const dls = require('/MarkLogic/dls');

declareUpdate()
  xdmp.documentAddProperties( 
              '/foo/bar/baz.xml', 
               ([fn.head(xdmp.unquote('<priority>1</priority>')).root,
                 fn.head(xdmp.unquote('<status>unedited</status>')).root]));

   

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.