@AppKu/StashKu

@AppKu/StashKu

v1.0.46

Class

GetRequest

This class defines a StashKu GET request that instructs StashKu to retrieve objects from storage.

Constructor

new GetRequest(…propertiesopt)

Creates a new PostRequest instance. A GET request instructs StashKu to retrieve objects from storage.

Parameters

  • properties String <optional>
    <repeatable>

    Spread of field names (aka: columns) to get from data storage.

Source

Members

Methods

count(enabledopt) → {GetRequest}

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 the flag.

Parameters

  • enabled Boolean <optional>
    true

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

Returns

Source

distinct(enabledopt) → {GetRequest}

Requests that the retrieved results be distinct among the selected (or all) properties.
Calling this function without an argument enables the flag.

Parameters

  • enabled Boolean <optional>
    true

    A true enables the distinct results. A false disables it.

Returns

Source

from(name) → {GetRequest}

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

headers(dictionary) → {GetRequest}

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

properties(…propertiesopt) → {GetRequest}

Adds properties to the GET request. If the property is already present, it is ignored.
If a null value is passed, all properties are cleared from the request.

Parameters

  • properties String | Modeling.PropertyDefinition <optional>
    <repeatable>

    Spread of property names (aka: columns) to get from data storage.

Returns

Source

skip(count) → {GetRequest}

Indicates the request wishes to skip over the specified number of objects in storage.

Parameters

  • count Number | String

    The number of models to skip over. Optionally, if the string "all" is provided, then the skip and take values will be cleared.

Returns

Source

sort(…sortsopt) → {GetRequest}

Adds sort criteria to the GET request. If the sort is already present, it is updated.
If a null value is passed, all sorts are removed.

Parameters

  • sorts Sort <optional>
    <repeatable>

    Spread of sorts which describe the order of results.

Returns

Throws

  1. Error if the any sorts argument value is not a string, Sort, null, or undefined.

  2. Error if the any sorts argument property is a blank string.

Source

take(count) → {GetRequest}

Hints that the request wishes to retrieve only the specified number of objects from storage.

Parameters

  • count Number | String

    The number of models to take. Optionally, if the string "all" is provided, then the skip and take values will be cleared.

Returns

Source

where(conditions) → {GetRequest}

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