Making queries with AQL

Now it’s possible to querieng database by using Arango Query Language (AQL).

This functionality implementation based on HTTP Interface for AQL Query Cursors and provide lazy iterator over dataset and with ability to customize (wrap) result item by custom wrapper.

Alternative way to do such king of functionality is by using Documents REST Api which is not implemented in driver.

class arango.cursor.Cursor(connection, query, count=True, batchSize=None, bindVars=None, wrapper=<bound method type.load of <class 'arango.document.Document'>>)

Work with Cursors in ArangoDB. At the moment, it’s common routine to work with AQL from this driver.

Note

the server will also destroy abandoned cursors automatically after a certain server-controlled timeout to avoid resource leakage.

  • query - contains the query string to be executed (mandatory)

  • count - boolean flag that indicates whether the

    number of documents found should be returned as “count” attribute in the result set (optional). Calculating the “count” attribute might have a performance penalty for some queries so this option is turned off by default.

  • batchSize - maximum number of result documents to be

    transferred from the server to the client in one roundtrip (optional). If this attribute is not set, a server-controlled default value will be used.

  • bindVars - key/value list of bind parameters (optional).

  • wrapper - by default it’s Document.load

    class, wrap result into

Custom data wrapper

It’s not necessary to wrap all documents within Document object.

Table Of Contents

Related Topics

This Page

Fork me on GitHub