new LiveView.Query(query, parameters, includeInternal)
Object that defines a LiveView query.
Name | Type | 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
-
queryString
-
The query string in parametrized form. For example: "Select * From ItemsSales Where lastSoldPrice > @minPrice"
-
parametersObject
-
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}).
-
includeInternalString
-
A flag indicating whether or not to include internal fields in (non-aggregate) query results.
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
-
serialize(){String}
-
Formats the query string as required by the LiveView server.
Returns:
The parameter-applied, server-formatted query string