@AppKu/StashKu

@AppKu/StashKu

v1.0.46

Class

PatchRequest

This class defines a StashKu PATCH request that instructs StashKu to update objects from storage with the specified properties and values.

Constructor

new PatchRequest(templateopt)

Creates a new PatchRequest instance. A PATCH request instructs StashKu to update objects from storage with the specified properties and values.

Parameters

  • template * <optional>

    A template object with properties and values to update in matching objects.

Source

Members

Methods

all(enabledopt) → {PatchRequest}

Enables the update of all objects in data storage if no where conditions are specified. If conditions are specified, this setting will be ignored.

Calling this method without an argument will set the request to enable the deletion of all objects.

Parameters

  • enabled Boolean <optional>
    true

    Enable or disable the deletion of all records when no where filters have been defined.

Returns

Source

count(enabledopt) → {PatchRequest}

Requests that the response return count numbers (total, affected, returned, etc.) but not objects.

This will result in a Response with an empty data array and may result in faster query execution if you only need the resulting numbers.

Calling this function without an argument enables counting without data.

Parameters

  • enabled Boolean <optional>
    true

    A true enables the count-only result. A false disables it.

Returns

Source

headers(dictionary) → {PatchRequest}

Sets or clears headers on the request that can be used to set engine-specific options for the request. If a null value is passed, the headers are cleared.

Parameters

  • dictionary Object | Map.<String, *>

    A map or object defining the headers and values.

Returns

Throws

  1. Error when the dictionary argument uses a non-string key.

  2. Error when the dictionary argument is not an object, null, or a Map.

Source

template(templateopt) → {PatchRequest}

Sets a template object with properties and values to update in objects matched by this PATCH request. If a null value is passed, the template is removed and no updates will occur.

Parameters

  • template * <optional>

    A template object with properties and values to update.

Returns

Source

to(name) → {PatchRequest}

Sets the target resource name for the request, optionally specifying an alias for use with specifying properties across joins.

Parameters

  • name String

    The name of the target resource in data storage.

Returns

Throws

Error if the "name" argument value is not a string or null.

Source

where(conditions) → {PatchRequest}

Creates a set of conditions on the request to match specific objects in storage.
Any existing where conditions will be overwritten.
If a null value is passed, the where conditions are cleared.

Parameters

Returns

Throws

Error if the "conditions" argument must be null or a Filter instance.

Source