Loading TOC...

MarkLogic 12 EA 1 Product Documentation
xdmp:document-put-metadata

xdmp:document-put-metadata(
   $uri as xs:string,
   $metadata as map:map
) as empty-sequence()

Summary

Adds metadata to the document. If any key already exists in the document metadata, the new specified value replaces the old one. Metadata values are strings. Non-string values are converted to strings.

Parameters
uri The document URI.
metadata Metadata in the key value pairs to set on the document.

Example

xdmp:document-put-metadata(
  "foo.xml",
  map:map(
    <map:map xmlns:map="http://marklogic.com/xdmp/map">
      <map:entry key="w">
        <map:value>world</map:value>
      </map:entry>
      <map:entry key="h">
        <map:value>hello</map:value>
      </map:entry>
    </map:map>
  )
)

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