Class Statement
Container for an AQL query
Optional bind parameters can be used when issuing the AQL query to separate the query from the values. Executing a query will result in a cursor being created.
There is an important distinction between two different types of statements:
- statements that produce an array of documents as their result AND
- statements that do not produce documents
For example, a statement such as "FOR e IN example RETURN e" will produce
an array of documents as its result. The result can be treated as an array of
documents, and each document can be updated and sent back to the server by
the client.
However, the query "RETURN 1 + 1" will not produce an array of documents as
its result, but an array with a single scalar value (the number 2).
"2" is not a valid document so creating a document from it will fail.
To turn the results of this query into a document, the following needs to
be done:
- modify the query to "RETURN { value: 1 + 1 }". The result will then be a an array of documents with a "value" attribute
- use the "_flat" option for the statement to indicate that you don't want to treat the statement result as an array of documents, but as a flat array
Methods summary
public
|
|
protected
|
|
public
|
|
public
array
|
|
public
array
|
|
public
|
|
public
string
|
|
public
|
|
public
array
|
|
public
|
|
public
string
|
|
public
string
|
|
public
|
|
public
boolean
|
|
public
|
|
public
boolean
|
|
public
|
|
public
boolean
|
|
public
|
|
public
integer
|
Constants summary
string |
ENTRY_QUERY
Query string index |
#
'query'
|
string |
ENTRY_COUNT
Count option index |
#
'count'
|
string |
ENTRY_BATCHSIZE
Batch size index |
#
'batchSize'
|
string |
ENTRY_RETRIES
Retries index |
#
'retries'
|
string |
ENTRY_BINDVARS
Bind variables index |
#
'bindVars'
|
string |
FULL_COUNT
Full count option index |
#
'fullCount'
|