<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.documentSetCollections.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.documentSetCollections</api:function-name><api:suggest>xdmp.documentsetcollections</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>documentsetcollections</api:suggest><api:function-link mode="xquery" fullname="xdmp:document-set-collections">/apidoc/8.0/xdmp:document-set-collections.xml</api:function-link><api:function mode="javascript" name="documentSetCollections" type="builtin" lib="xdmp" category="UpdateBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.documentSetCollections"><api: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 <code xmlns="http://www.w3.org/1999/xhtml">xdmp:document-add-collections</code>.  For each
  collection that is protected, the user must have permissions to update
  that collection or have the <code xmlns="http://www.w3.org/1999/xhtml">any-collection</code> privilege.  For each
  unprotected collection, the user must have the
  <code xmlns="http://www.w3.org/1999/xhtml">unprotected-collections</code> privilege.
</api:summary><api:params><api:param name="uri" type="xs:string"><api:param-description>
    The document URI.
  </api:param-description><api:param-name>uri</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="collections" type="xs:string*"><api:param-description>
    A set of collection URIs.
  </api:param-description><api:param-name>collections</api:param-name><api:param-type>String[]</api:param-type></api:param></api:params><api:return>null</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
declareUpdate();
var colls = [ "http://examples.com", "http://marklogic.com" ];
xdmp.documentSetCollections("/example.json", colls);
</pre></api:example></api:function></api:function-page>