10

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?

yojimbo87
  • 59,764
  • 22
  • 119
  • 130
poseid
  • 6,456
  • 9
  • 45
  • 74

1 Answers1

6

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

thesilentman
  • 768
  • 5
  • 17
  • 1
    Thanks! In the documentation there is written: "You can run AQL queries from your application via the HTTP REST API" ... so, I also could run AQL with e.g. Curl ? – poseid Feb 18 '13 at 11:24
  • 1
    Exactly. In fact, all language drivers use the HTTP REST API. The REST API is ArangoBD's interface to the world. If for example you program in a language that has no driver available yet, you can start a project writing your own driver. It's all HTTP. – thesilentman Feb 18 '13 at 11:29
  • Not sure about the status of things at Feb, but with AQL you can definitely change and store data into database (example: https://www.arangodb.com/tutorial-node-js/#aql-update). It does not matter how the AQL is run, it has always the same capabilities. – mohamnag Dec 07 '15 at 18:04
  • On February >2013< things were different... ;) Nevertheless, I'll update the answer to account for the new features... – thesilentman Dec 07 '15 at 21:12