Load Files to Marklogic Server By using info:load
xquery version "1.0-ml";
import module namespace info =
"http://marklogic.com/appservices/infostudio"
at
"/MarkLogic/appservices/infostudio/info.xqy";
let $delta := <options
xmlns="http://marklogic.com/appservices/infostudio">
<collection>/test</collection>
<uri>
<literal>/mydir/</literal>
<filename/>
<literal>.</literal>
<ext/>
</uri>
</options>
return info:load("C:\TestFolder", (), $delta, "test")
· Now all of your Documents has 2 collections
o
/tickets/ticket/########### (Built-in collection
added by info api)
o
/test (User defined collection)
· If you have multiple documents you have implement above step in loop. For Example,
for $each in xdmp:directory("/mydir/","infinity")
return
xdmp:document-remove-collections ( fn:base-uri($each),"/tickets/ticket/###")
No comments:
Post a Comment