Namespace: snippet

snippet

Provides functions that maintain query snippet extensions on the REST server. The client must have been created for a user with the rest-admin role.

Methods


list() → {ResultProvider}

Lists the custom query libraries installed on the server.
Since:
  • 1.0
Returns:
an object whose result() function takes a success callback that receives the list of replacement libraries
Type
ResultProvider

read(moduleName) → {ResultProvider}

Reads a query snippet library installed on the server.
Parameters:
Name Type Description
moduleName string the filename without a path for the query snippet library
Since:
  • 1.0
Returns:
an object whose result() function takes a success callback that receives the source code for the library
Type
ResultProvider

remove(moduleName)

Deletes a query snippet library from the server.
Parameters:
Name Type Description
moduleName string the filename without a path for the query snippet library
Since:
  • 1.0

write(moduleName, permissions, source)

Installs a query snippet library on the server.
Parameters:
Name Type Argument Description
moduleName string the filename without a path for the query snippet library; the filename must end in an extension registered in the server's mime type mapping table for the mime type of the source code format; at present, the extension should be ".xqy"
permissions Array.<object> <optional>
the permissions controlling which users can read, update, or execute the query snippet library
source string the source code for the query snippet library; at present, the source code must be XQuery
Since:
  • 1.0
Copyright (c) 2020 MarkLogic Corporation Documentation generated by JSDoc 3.6.4 on 2020-08-04T23:55:49-07:00 using the DocStrap template.