Loading TOC...

MarkLogic 12 EA 2 Product Documentation
fn:doc

fn:doc(
   [$uri as xs:string*]
) as document-node()*

Summary

Returns the document(s) stored in the database at the specified URI(s).

Parameters
$uri The URI of the document to retrieve. If you omit this parameter, returns all of the documents in the database - this is only allowed if you're not using xquery version 1.0 strict. If you specify a list of URIs, returns all of the documents at the URIs specified in the list.

Usage Notes

The document-node() returned for each item in the result contains an element() root node for XML documents, a text() root node for text documents, an object-node(), array-node(), or another JSON node for a JSON document, and a binary() root node for binary documents.

Example

fn:doc("/mydocs/doc.xml")

=> returns the document at the URI /mydocs/doc.xml

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