1
0
Fork 0
arangodb/Documentation/Books/Users/AqlExamples
CoDEmanX e22fa64bcf Fix and unify asterisks, tested with GitBook.
Italic asterisks should be done by escaping the asterisk and wrapping it with html i-tag. It seems to be the only safe technique (3 asterisks to display 1 italic asterisk in a list works, unless followed by more markup for italic text; 1 escaped asterisk wrapped by i-tag works regardless of the rest of the line).
2014-08-29 18:19:45 +02:00
..
CollectionQueries.mdpp Added glossary to the documentation. Also linked the glossary keywords to the documentation 2014-08-05 15:49:21 +02:00
DataModificationQueries.mdpp issue #1005: updated documentation 2014-08-29 09:09:35 +02:00
Grouping.mdpp Fix and unify asterisks, tested with GitBook. 2014-08-29 18:19:45 +02:00
Join.mdpp Changed some (sub)chapters and fixed spelling errors 2014-06-27 11:02:10 +02:00
ProjectionsAndFilters.mdpp Changed some (sub)chapters and fixed spelling errors 2014-06-27 11:02:10 +02:00
README.mdpp Changed some (sub)chapters and fixed spelling errors 2014-06-27 11:02:10 +02:00

README.mdpp

!CHAPTER AQL Examples

This page contains some examples how to write queries in AQL. For better
understandability the query results are also included directly below each query.

!SECTION Simple queries

Following is a query that returns a string value. The result string is contained in a list
because the result of every valid query is a list:

```js
RETURN "this will be returned"
[ 
  "this will be returned" 
]
```

Here is a query that creates the cross products of two lists and runs a projection 
on it, using a few of AQL's built-in functions:

```js
FOR year in [ 2011, 2012, 2013 ]
  FOR quarter IN [ 1, 2, 3, 4 ]
    RETURN { 
      "y" : "year", 
      "q" : quarter, 
      "nice" : CONCAT(TO_STRING(quarter), "/", TO_STRING(year)) 
    }
[ 
  { "y" : "year", "q" : 1, "nice" : "1/2011" }, 
  { "y" : "year", "q" : 2, "nice" : "2/2011" }, 
  { "y" : "year", "q" : 3, "nice" : "3/2011" }, 
  { "y" : "year", "q" : 4, "nice" : "4/2011" }, 
  { "y" : "year", "q" : 1, "nice" : "1/2012" }, 
  { "y" : "year", "q" : 2, "nice" : "2/2012" }, 
  { "y" : "year", "q" : 3, "nice" : "3/2012" }, 
  { "y" : "year", "q" : 4, "nice" : "4/2012" }, 
  { "y" : "year", "q" : 1, "nice" : "1/2013" }, 
  { "y" : "year", "q" : 2, "nice" : "2/2013" }, 
  { "y" : "year", "q" : 3, "nice" : "3/2013" }, 
  { "y" : "year", "q" : 4, "nice" : "4/2013" } 
]
```