let $db := xdmp:databases()[1]
let $db-name := xdmp:database-name($db)
let $db-forests := xdmp:database-forests($db, fn:false())
let $forests-name := xdmp:forest-name($db-forests)
let $forests-name := for $f in xdmp:forest-name($db-forests)
order by $f ascending
return $f
let $forest-status := xdmp:forest-status($db-forests)
let $map := map:map()
let $_ := for $f in $forests-name
let $host-id := $forest-status/f:host-id/text() where ($forest-status/f:forest-name[. = $f] and ($forest-status/f:availablility/text() eq "online"))
let $_ := if(map:contains(xdmp:host-name($host-id))) then() else()
return $host-id
return $forest-status
我收到错误,因为我没有正确使用Xquery。请指导我。
答案 0 :(得分:3)