Loading TOC...

MarkLogic Server 11.0 Product Documentation
xdmp.documentSetCollections

xdmp.documentSetCollections(
   uri as String,
   collections as String[]
) as null

Summary

Sets the named document to belong to the given collections, replacing any previously set collections on the named document. To preserve existing collections, use xdmp:document-add-collections. For each collection that is protected, the user must have permissions to update that collection or have the any-collection privilege. For each unprotected collection, the user must have the unprotected-collections privilege.

Parameters
uri The document URI.
collections A set of collection URIs.

Example

declareUpdate();
var colls = [ "http://examples.com", "http://marklogic.com" ];
xdmp.documentSetCollections("/example.json", colls);

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