
admin:database-backup-get-enabled( $config as element(configuration), $database-id as xs:unsignedLong, $backup-id as xs:unsignedLong ) as xs:boolean
This function returns true or false to indicate whether a specific backup is enabled for a database.
| Parameters | |
|---|---|
| config | A configuration specification, typically as returned from one of the Admin module functions. |
| database-id | The ID for the
database (for example, xdmp:database("myDatabase")
). |
| backup-id | The ID of the backup,
found by XPath to the backup location (for example, //db:backup-id/).
|
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";
let $backup-ids := admin:database-get-backups(
admin:get-configuration(), xdmp:database("Documents"))//db:backup-id/fn:data()
return
admin:database-backup-get-enabled(admin:get-configuration(),
xdmp:database("Documents"), $backup-ids)
=>
true
true
true
(: returns the backup enabled settings for the database - true or false :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.