[starting from version: 2.8]
A request for data.
Request
{
"type": "select"
"index": string,
"query": {
"fields"[]: FieldObject,
"filter"[]: FilterObject,
"limit": number
},
"page": number
}
The request has the following parameters:
type
— String. The type of the request. In this case, it is "select"
.index
– String. The dataset identifier. query
– Object. A query object. Contains the following properties:fields
– Array of Field Objects. An array of fields (columns) to include in the response. filter
(optional) – Array of Filter Objects|Filter Group Object. Query filters. The part of a query that specifies which filters should be applied to the data.false
), the filter’s structure is an array of Filter Objects.2.8.5
or /handshake is not implemented.2.8.22
or later.limit
– Number. The maximum number of records that should be included in the response. Сonfigurable on the client. Default value: 1000
.page
– Number. The page number. It can be used to load data by parts. If the response contains the pageTotal
parameter, additional requests will be performed to load the remaining pages. Starts from 0
.Response
{
"fields"[]: {
"uniqueName": string
},
"hits"[]: [
(index): string | number
],
"page": number,
"pageTotal": number
}
The response has the following parameters:
fields
– Array of objects. Fields (columns) included in the response. Each object in the array has the following properties: uniqueName
– String. The field’s unique name. hits
– Array. A two-dimensional array containing data:(index)
– String | Number. A data row, where (index)
is a field (column) index.page
(optional) – Number. The current page number. Starts from 0
.pageTotal
(optional) – Number. The total number of pages. It can be used to load members by parts.Example
Request:
{
"index": "data-set-123",
"type": "select",
"query": {
"fields": [
{
"uniqueName": "country"
},
{
"uniqueName": "city"
},
{
"uniqueName": "price"
},
{
"uniqueName": "quantity"
}
],
"filter"[]: {
"field": {
"uniqueName": "country"
},
"include": [
{
"member": "Canada"
}
]
},
"limit": 1000
},
"page": 0
}
Response:
{
"fields": [
{ "uniqueName": "country" },
{ "uniqueName": "city" },
{ "uniqueName": "price" },
{ "uniqueName": "quantity" }
],
"hits": [
["Canada", "Toronto", 53, 2],
["Canada", "...", 1, 1]
]
}
See also
/handshake request
/fields request
/members request
/select request for pivot table
/select request for flat table
Field Object