Namespace: snippet
snippet
Provides functions 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.
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 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 -
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
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