Created
February 17, 2016 10:13
-
-
Save ableasdale/80d2a3bf2f3bfe6e50ac to your computer and use it in GitHub Desktop.
Sample CSV output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare namespace obj="http://marklogic.com/solutions/obi/object"; | |
declare function local:header(){ | |
text {"One,Two"} | |
}; | |
declare function local:process($uri as xs:string) { | |
text {fn:string-join((cts:element-values(xs:QName("obj:id"), (), (), cts:document-query($uri)), cts:element-values(xs:QName("obj:type"), (), (), cts:document-query($uri))), ",")} | |
}; | |
( | |
xdmp:add-response-header("Content-Type", 'text/plain; charset=utf-8'), | |
local:header(), | |
local:process(cts:uris((), ("limit=500"), cts:collection-query("object") )) | |
) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment