Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should I use AQL?

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

  • arangosh: The JavaScript based console

  • AQL: Arangodb Query Language, see http://www.arangodb.org/2012/06/20/querying-a-nosql-database-the-elegant-way

  • MRuby: Embedded Ruby

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?

like image 966
poseid Avatar asked Feb 18 '13 09:02

poseid


People also ask

When Should acceptance sampling be used?

Acceptance sampling is employed when one or several of the following hold: Testing is destructive. The cost of 100% inspection is very high. 100% inspection takes too long.

Why do we use AQL?

AQL is highly flexible because it allows you to customize your quality tolerance for your product and for the three types of quality defects: critical, major and minor. Consumer products often use AQLs of 0, 2.5 and 4.0 for critical, major and minor defects, respectively.

At what point should a company use 100% inspection?

100% QC inspections are usually reserved for products that have strict safety requirements and low tolerance for defects. They are usually not necessary for standard consumer-grade products.

How do I select AQL and inspection level?

As a manufacturer, you just have to understand your products, the market you want to sell them, and the end consumer of your products. The decision of defect tolerance lies with you. If you decide that the defect tolerance for the whole batch of your products should not be beyond 1.5%, then that is your AQL.


1 Answers

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

like image 115
thesilentman Avatar answered Oct 05 '22 23:10

thesilentman