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 default element namespace "http://marklogic.com/xdmp/status/forest"; | |
declare variable $path as xs:string := '/PATH/TO/support-request-go.xqy.txt'; | |
declare variable $support as document-node()* := xdmp:document-get( | |
$path, | |
<options xmlns="xdmp:document-get"> | |
<format>xml</format> |
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"; | |
import module namespace pki = "http://marklogic.com/xdmp/pki" at "/MarkLogic/pki.xqy"; | |
pki:insert-trusted-certificates( | |
xdmp:document-get("/tmp/rootca.cer", | |
<options xmlns="xdmp:document-get"> | |
<format>text</format> | |
</options>) | |
) |
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"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $dbname := "DATABASE-NAME_HERE"; | |
declare variable $CONFIG := admin:get-configuration(); | |
( | |
(: Create Master Forests - A :) | |
for $j in 1 to 5 |
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 ss = "http://marklogic.com/xdmp/status/server"; | |
for $host in xdmp:group-hosts(xdmp:groups()) | |
for $server in xdmp:group-servers(xdmp:groups()) | |
return | |
xdmp:server-status($host, $server)//ss:request-status |
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 variable $USER as xs:string := "username"; | |
declare variable $PASS as xs:string := "password"; | |
declare variable $HOSTS as xs:unsignedLong+ := for $i in xdmp:groups() return xdmp:group-hosts($i); | |
declare variable $PORT as xs:unsignedLong := 8002; | |
declare variable $ENDPOINT as xs:string := "/v1/eval"; | |
declare variable $PAYLOAD as xs:string := xdmp:quote("xquery=xdmp:expanded-tree-cache-clear()"); | |
declare variable $OPTIONS as element() := |
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
cts:collections() ! element collection-name {attribute count {xdmp:estimate(cts:search(doc(), cts:collection-query(.)))}, .} |
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
declare namespace server ="http://marklogic.com/xdmp/status/server"; | |
declare variable $host := xdmp:host(); | |
for $server in xdmp:servers() | |
return | |
for $request in xdmp:server-status($host,$server)//server:request-status | |
let $transaction-id := $request/server:transaction-id | |
let $start-time := $request/server:start-time/text() | |
order by $request/server:start-time ascending |
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
let $read := fn:doc("/thread-1-output.xml") | |
return | |
xdmp:document-insert("/thread-2-output.xml",element root{"Thread 2 finished",element elapsed-time{xdmp:elapsed-time()}}) | |
; | |
fn:doc("/thread-2-output.xml") |
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
let $read := fn:doc("/for-read-lock.xml") | |
return | |
xdmp:document-insert("/thread-2-output.xml",element root{"Thread 2 finished",element elapsed-time{xdmp:elapsed-time()}}) | |
; | |
fn:doc("/thread-2-output.xml") |
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
let $sleep-time-seconds := 20 | |
let $read := fn:doc("/for-read-lock.xml") | |
let $_ := xdmp:document-insert("/thread-1-output.xml",element root{"Thread 1 finished"}) | |
return | |
xdmp:sleep($sleep-time-seconds * 1000) | |
; | |
fn:doc("/thread-1-output.xml") |