Marklogic add collection to documents in a collection

MarkLogic Server 11.0 Product Documentation xdmp:document-set-collections
xdmp:document-set-collections( $uri as xs:string, $collections as xs:string* ) as empty-sequence()

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

xdmp:document-set-collections( "/example.xml", ("http://examples.com", "http://marklogic.com"))

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

Copyright © 2024 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, Ipswitch, Chef, Kemp, Flowmon, MarkLogic, Semaphore and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. Any other trademarks contained herein are the property of their respective owners. See Trademarks for appropriate markings.