op:from-doc-uris( $query as item()*, [$qualifier as xs:string?] ) as map:map
This function matches and returns the uri for documents.
Parameters | |
---|---|
$query | Qualifies a set of documents. The query can be a cts:query or as a sequence of document URI string literals. |
$qualifier | Specifies a name for qualifying the column names. |
The op:from-doc-uris
function provides a convenience equivalent to the following:
declare function op:from-doc-uris( $query as item()*, $qualifier as xs:string? ) as map:map { return op:from-lexicons( map:entry("uri", cts:uri-reference()), $qualifier, op:fragment-id-col("fragmentId") ) =>op:where($query) };
xquery version "1.0-ml"; import module namespace op="http://marklogic.com/optic" at "/MarkLogic/optic.xqy"; op:from-doc-uris(cts:word-query("tiger", ("case-sensitive"))) =>op:result()
xquery version "1.0-ml"; import module namespace op="http://marklogic.com/optic" at "/MarkLogic/optic.xqy"; let $uriSeq := ('/test/fromDocUris/0.json', '/test/fromDocUris/1.json', '/test/fromDocUris/2.json') return op:from-doc-uris($uriSeq) =>op:result()
xquery version "1.0-ml"; import module namespace op="http://marklogic.com/optic" at "/MarkLogic/optic.xqy"; let $docColIdentifier := map:map()=>map:with("doc", "doc") return op:from-doc-uris(cts:word-query('duck', ('case-sensitive'))) =>op:join-doc-cols($docColIdentifier, op:col("uri")) =>op:order-by("uri") =>op:result()