Loading TOC...

MarkLogic Server 11.0 Product Documentation
plugin:flush-scope

plugin:flush-scope(
   $scope as xs:string,
   [$pid as xs:string?]
) as empty-sequence()

Summary

This function unloads all application plugins from a given scope. Note that system plugins are unaffected by this function. Like plugin:initialize-scope, this function requires the application-plugin-registrar role.

Parameters
scope A scope identifier. This must be a "dotted" package-style path, which will be resolved relative to the marklogic-dir/Assets/plugins directory. For example, a $scope value of my-plugin-scope is resolved to the marklogic-dir/Assets/plugins/myplugin-scope directory and a $scope value of my.plugin.scope is resolved to the marklogic-dir/Assets/plugins/my/plugin/scope directory.
pid A plugin ID.

Required Privileges

This function requires the privileges in the application-plugin-registrar role, and the best practice is to put plugin:flush-scope in a function that is amped to the application-plugin-registrar role.

Example

xquery version "1.0-ml"; 
 
import module namespace plugin = "http://marklogic.com/extension/plugin" 
      at "/MarkLogic/plugin/plugin.xqy";

plugin:flush-scope("marklogic.appservices")

(: Unloads all of the plugins located in /Assets/plugins/marklogic/appservices :)

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