Query
Parse an C8QL query
This endpoint is for query validation only. To query the database, see /api/cursor.
post/_fabric/{fabric}/_api/query
Request
- The document declares no server URL.
- Auth
- API key in header Authorization
- or HTTP bearer
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
fabricstring string required
The name of the fabric.
Request body
Example request
{
"query": "for u in testCollection return u"
}Response
Successfull fetched collections attributes with an array of collections used in the query and bindVars attribute with names of the bind parameters found in the query (if any).
If the query is parsed successfully, the ast attribute of the returned JSON contain the abstract syntax tree representation of the query. The format of the ast is subject to change in future versions of database, but it can be used to inspect how database interprets a given query. Note that the abstract syntax tree is returned without any optimizations applied to it.
unknown required
Example response
{
"code": 200,
"error": false,
"parsed": true,
"collections": [
"testCollection"
],
"bindVars": [],
"ast": [
{
"type": "root",
"subNodes": [
{
"type": "for",
"subNodes": [
{
"type": "variable",
"name": "u",
"id": 0
},
{
"type": "collection",
"name": "testCollection"
},
{
"type": "no-op"
}
]
},
{
"type": "return",
"subNodes": [
{
"type": "reference",
"name": "u",
"id": 0
}
]
}
]
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.