<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.documentGetCollections.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.documentGetCollections</api:function-name><api:suggest>xdmp.documentgetcollections</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>documentgetcollections</api:suggest><api:function-link mode="xquery" fullname="xdmp:document-get-collections">/apidoc/8.0/xdmp:document-get-collections.xml</api:function-link><api:function mode="javascript" name="documentGetCollections" type="builtin" lib="xdmp" category="Extension" subcategory="Extension" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.documentGetCollections"><api:summary>
  Returns the collections to which a given document belongs.
</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:params><api:return class="javascript">String[]</api:return><api:usage class="javascript">
  If the URI passed in doesn't exist, an empty array is returned.
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xdmp.documentGetCollections("chapter5.json")
=&gt; ["http://marklogic.com/all-books",
        "http://marklogic.com/xml-books"]
</pre></api:example></api:function></api:function-page>