Loading TOC...

MarkLogic 12 EA 1 Product Documentation
admin.databaseDeleteBackupById

admin.databaseDeleteBackupById(
   config as element(configuration),
   database-id as (Number|String),
   backup-id as (Number|String)[]
) as element(configuration)

Summary

This function deletes a specific scheduled backup configuration, identified by the backup ID.

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 configuration to delete, found by XPath to the backup location(for example, //db:backup-id/).

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/database

http://marklogic.com/xdmp/privileges/admin/database/backup

http://marklogic.com/xdmp/privileges/admin/database/backup/{id}

Example

 
 const admin = require('/MarkLogic/admin.xqy');

 const db = "http://marklogic.com/xdmp/database";
 const backupIds = admin.databaseGetBackups(
 admin.getConfiguration(), xdmp.database("Documents"))//db.backupId/fn.data()
 admin.databaseDeleteBackupById(admin.getConfiguration(),
 xdmp.database("Documents"), backupIds)
   //deletes the database backups by ID -- use admin.saveConfiguration
   //to save the changes to the configuration or pass the configuration
   //to other Admin API functions to make other changes.  
     

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.