
admin.forestForeignMasterGetDatabaseId( foreign-master as element(as.foreignMaster) ) as (Number|String)
This function returns the id for the database from the foreign master forest configuration element.
let admin = require("/MarkLogic/admin.xqy")
let cfg = admin.getConfiguration()
let fmforest = admin.forestGetForeignMaster(cfg, xdmp.forest("Documents"))
admin.forestForeignMasterGetDatabaseId(fn.head(fmforest))
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.