Pergunta

In the context of ArangoDB, there are different database shells to query data:

Although I understand the use of JavaScript and MRuby, I am not sure why I would learn, and where I would use AQL. Is there any information on this? Is the idea to POST AQL directly to the database server?

Foi útil?

Solução

AQL is ArangoDB's query language. It has a lot of ways to query, filter, sort, limit and modify the result that will be returned. It should be noted that AQL only reads data.

(Update: This answer was targeting an older version of ArangoDB. Since version 2.2, the features have been expanded and data modification on the database is also possible with AQL. For more information on that, visit the documentation link at the end of the answer.)

You cannot store data to the database with AQL.

In contrast to AQL, the Javascript or MRuby can read and store data to the database. However their querying capabilities are very basic and limited, compared to the possibilities that open up with AQL.

It is possible though to send AQL queries from javascript. Within the arangosh Javascript shell you would issue an AQL query like this:

    arangosh> db._query('FOR user IN example FILTER user.age > 30 RETURN user').toArray()
[
  { 
    _id : "4538791/6308263", 
    _rev : "6308263", 
    age : 31, 
    name : "Musterfrau"
   }
]

You can find more info on AQL here: http://www.arangodb.org/manuals/current/Aql.html

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top