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
xdmp:document-insert("/for-read-lock.xml",element root{}); |
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
grep "found in forests" all_dbdupuri_messages.txt | awk -F 'found in forests' '{print $2; print $3}' | cut -d " " -f2-4 | sort -n | uniq -c |
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"; | |
(: Note this will only work with Application Servers within the default group - change "Default" on line 8 for other groups if you need to :) | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare namespace grp = "http://marklogic.com/xdmp/group"; | |
declare variable $config as element(configuration) := admin:get-configuration(); | |
declare variable $group-id as xs:unsignedLong := admin:group-get-id($config, "Default"); |
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"; | |
for $host in xdmp:hosts() | |
for $server in xdmp:group-servers(xdmp:host-group($host)) | |
return xdmp:server-status($host,$server) |
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 namespace db = "http://marklogic.com/xdmp/database"; | |
declare variable $configurations := admin:database-copy(admin:get-configuration(), xdmp:database("Documents"), "XXXXXXXXXXXXXXX"); | |
for $i in $configurations/db:databases/db:database | |
where fn:not($i/db:database-name eq "XXXXXXXXXXXXXXX") |
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 tde = "http://marklogic.com/xdmp/tde" | |
at "/MarkLogic/tde.xqy"; | |
let $employees := | |
<template xmlns="http://marklogic.com/xdmp/tde"> | |
<context>/Employee</context> | |
<rows> | |
<row> |
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
declareUpdate(); | |
xdmp.documentInsert( | |
"/employee1.json", | |
{ "Employee": { | |
"ID": 1, | |
"FirstName": "John", | |
"LastName": "Widget", | |
"Position": "Manager of Human Resources" }}), | |
xdmp.documentInsert( | |
"/employee2.json", |
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
<Root> | |
<Batch> | |
<Documents> | |
<Document> | |
<Tag id = "elem1">value1</Tag> | |
<Tag id = "elem2">value2</Tag> | |
</Document> | |
<Document> | |
<Tag id = "elem1">value1</Tag> | |
<Tag id = "elem2">value2</Tag> |
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 trgr = "http://marklogic.com/xdmp/triggers"; | |
declare namespace dom = "http://marklogic.com/cpf/domains"; | |
declare namespace pipelines = "http://marklogic.com/cpf/pipelines"; | |
declare variable $DATABASE as xs:string := "Triggers"; | |
declare variable $OTHER-DOCS as xs:string+ := ("http://marklogic.com/cpf/configuration/configuration.xml", "/cpf/domains.css", "/cpf/pipelines.css"); | |
declare function local:schedule-delete($uris as xs:string+) { |
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 function local:get-estimate-for-database-by-id($id as xs:unsignedLong) as xs:unsignedLong { | |
xdmp:invoke-function(function() { xdmp:estimate(doc()) }, | |
<options xmlns="xdmp:eval"> | |
<database>{$id}</database> | |
</options>) | |
(: xdmp:database("Documents") :) | |
}; |