Query

LiveView. Query

new Query(query, parametersopt, includeInternalopt)

Object that represents a LiveView query. This object is used as a parameter when calling execute or subscribe. It stores the query string (in parameterized format) as well as the parameters to apply when invoking execute or subscribe.
Parameters:
Name Type Attributes Description
query String The optionally-parametrized query string
parameters Object <optional>
A key-value map of parameters to use to compute the query string, if query is a parametrized string. Users are essentially free to define the key value used to identify a parameter as they wish. The query string is generated using regular expression substitution, so avoidance of regular expression special characters is recommended as it will likely cause unexpected behavior. The '@' character as a parameter prefix works well (e.g. {'@priceMin':100, '@lastUpdated':1415230518223}).
includeInternal boolean <optional>
A flag indicating whether or not to include internal fields in (non-aggregate) query results.

Members

includeInternal :boolean

A flag indicating whether or not to include internal fields in (non-aggregate) query results.
Type:
  • boolean

parameters :Object

A key-value map of parameters to use to compute the query string, if query is a parametrized string. Users are essentially free to define the key value used to identify a parameter as they wish. The query string is generated using regular expression substitution, so avoidance of regular expression special characters is recommended as it will likely cause unexpected behavior. The '@' character as a parameter prefix works well (e.g. {'@priceMin':100, '@lastUpdated':1415230518223}).
Type:
  • Object

query :String

The query string in parametrized form. For example: "Select * From ItemsSales Where lastSoldPrice > @minPrice"
Type:
  • String

Methods

getQueryString() → {String}

Applies parameters to the query and returns the resulting query string. If this is not a parametrized query, this will be equivalent to the query field.
Returns:
-- The parameter-applied query string
Type
String

serialize() → {String}

Formats the query string as required by the LiveView server.
Returns:
-- The parameter-applied, server-formatted query string
Type
String