dba/stores
library moduleR
Summary
Kill web sessions.
- Authors
- Christian Grün, BaseX Team 2005-23, BSD License
Imports
This module is imported by 0 modules. It imports 1 modules.
Variables
Functions
4.1 dba:deletekeys
Arities: #1R
dba:deletekeys
(
$ids
as
xs:string*
) as
element(rest:response)
- ids
as
xs:string*
keys
element(rest:response)
redirection
Invoked by 0 functions from 0 modules
Annotations (3)
%rest:GET | () |
%rest:path | ('/dba/stores-deletekeys') |
%rest:query-param | ('id','{$ids}') |
Source ( 11 lines)
function dba:deletekeys(
$ids as xs:string*
) as element(rest:response) {
try {
for $id in $ids
return store:delete($id),
web:redirect($dba:CAT, map { 'info': util:info($ids, 'keys', 'deleted') })
} catch * {
web:redirect($dba:CAT, map { 'error': $err:description })
}
}
Namespaces
The following namespaces are defined:
Prefix | Uri |
---|---|
dba | dba/stores 2 |
err | http://www.w3.org/2005/xqt-errors |
rest | http://exquery.org/ns/restxq |
util | dba/util |
web | http://basex.org/modules/web |
xs | http://www.w3.org/2001/XMLSchema |
Source Code
(:~
: Kill web sessions.
:
: @author Christian Grün, BaseX Team 2005-23, BSD License
:)
module namespace dba = 'dba/stores';
import module namespace util = 'dba/util' at '../lib/util.xqm';
(:~ Top category :)
declare variable $dba:CAT := 'stores';
(:~
: deletes keys from store
: @param $ids keys
: @return redirection
:)
declare
%rest:GET
%rest:path('/dba/stores-deletekeys')
%rest:query-param('id', '{$ids}')
function dba:deletekeys(
$ids as xs:string*
) as element(rest:response) {
try {
for $id in $ids
return store:delete($id),
web:redirect($dba:CAT, map { 'info': util:info($ids, 'keys', 'deleted') })
} catch * {
web:redirect($dba:CAT, map { 'error': $err:description })
}
};