Namespace: resources

resources

Provides functions to execute resource services on the REST server for the client. The resource service extensions must have been installed previously on the REST server using the config.resources#write function.

Methods


get(name, params, txid) → {ResultProvider}

Invokes the get() function in the resource service. The arguments must be passed as a single object with a property for each parameter.
Parameters:
Name Type Argument Description
name string the name of the service
params object <optional>
an object in which each property has a variable name as a key and a number, string, or boolean value
txid string | transactions.Transaction <optional>
a string transaction id or Transaction object identifying an open multi-statement transaction
Since:
  • 1.0
Returns:
an object whose stream() function returns a stream that receives the response
Type
ResultProvider

post(name, params, documents, txid) → {ResultProvider}

Invokes the post() function in the resource service. The arguments must be passed as a single object with a property for each parameter.
Parameters:
Name Type Argument Description
name string the name of the service
params object <optional>
an object in which each property has a variable name as a key and a number, string, or boolean value
documents string | object | Buffer | ReadableStream <optional>
any document content to send to the server
txid string | transactions.Transaction <optional>
a string transaction id or Transaction object identifying an open multi-statement transaction
Since:
  • 1.0
Returns:
an object whose stream() function returns a stream that receives the response
Type
ResultProvider

put(name, params, documents, txid)

Invokes the put() function in the resource service. The arguments must be passed as a single object with a property for each parameter.
Parameters:
Name Type Argument Description
name string the name of the service
params object <optional>
an object in which each property has a variable name as a key and a number, string, or boolean value
documents string | object | Buffer | ReadableStream <optional>
any document content to send to the server
txid string | transactions.Transaction <optional>
a string transaction id or Transaction object identifying an open multi-statement transaction
Since:
  • 1.0

remove(name, params, txid)

Invokes the delete() function in the resource service. The arguments must be passed as a single object with a property for each parameter.
Parameters:
Name Type Argument Description
name string the name of the service
params object <optional>
an object in which each property has a variable name as a key and a number, string, or boolean value
txid string | transactions.Transaction <optional>
a string transaction id or Transaction object identifying an open multi-statement transaction
Since:
  • 1.0
Copyright (c) 2020 MarkLogic Corporation Documentation generated by JSDoc 4.0.0 on 2024-08-19T23:06:48-07:00 using the DocStrap template.