Skip to main content

SELECT

POST 

The SELECT statement is used to select on or multiple documents in a selection

SELECT statement syntax

//--- short form
SELECT FROM [collection_name];

//--- long form
SELECT [*, field, field AS alias, $vars, ...]
FROM [collection_name]
WHERE [$where:dict, a=b, ... ]
ORDER BY [$sort_by, field ASC|DESC]
OFFSET [$offset:number]
LIMIT [$limit:number]
LIMIT [$limit:number, $offset:number];

Query Example

{
"query": "SELECT * FROM articles WHERE $where SORT BY _created_at ASC LIMIT 10",
"variables": {
"where": {
"categories": "blog"
}
}
}

Request

Body

    query stringrequired

    The X-SQL Query string

    variables objectrequired

    The variables

Responses

Query response

Schema
    data object[]
    meta object
    pagination object
    page integer
    per_page integer
    total_pages integer
    size integer
    count integer
    has_next boolean
    next_page integer
    has_prev boolean
    prev_page integer
    page_showing_start integer
    page_showing_end integer
Loading...