ArangoDB Query Language (or AQL) is a declarative querying language used inside the multi-model database ArangoDB.
Questions tagged [aql]
448 questions
19
votes
1 answer
What is the fastest ArangoDB friends-of-friends query (with count)
I'm trying to use ArangoDB to get a list of friends-of-friends. Not just a basic friends-of-friends list, I also want to know how many friends the user and the friend-of-a-friend have in common and sort the result.
After several attempts at…

Terry Seidler
- 2,043
- 15
- 28
15
votes
1 answer
How to optimize graph traversals in ArangoDB?
I primarily intended to ask this question : "Is ArangoDB a true graph database ?"
But, this question would sound quite offending.
You, peoples at triAGENS, did a really great job in creating a "multi-paradigm" database.
As a user of PostgreSQL,…

Raphaël Braud
- 1,489
- 10
- 14
13
votes
4 answers
Extract some part of text separated by a delimiter using a regex
I have a sample input file as follows, with columns Id, Name, start date, end date, Age, Description, and Location:
220;John;23/11/2008;22/12/2008;28;Working as a professor in University;Hyderabad
221;Paul;30;23/11/2008;22/12/2008;He is a software…

mahodaya
- 167
- 1
- 1
- 6
11
votes
1 answer
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…

poseid
- 6,986
- 10
- 48
- 78
8
votes
2 answers
Query ArangoDB for Arrays
I am having a problem querying ArangoDB in java for a value of Arrays. I have tried with both String[] and ArrayList, both with no success.
My query:
FOR document IN documents FILTER @categoriesArray IN document.categories[*].title RETURN…

JosephG
- 3,111
- 6
- 33
- 56
8
votes
1 answer
ArangoDB AQL Non Case Sensitive Comparison
Let's imagine I have a few simple docs stored in an Arango collection like so:
[
{"type":Cat, "quality":Fuzzy}
{"type":Dog, "quality":Barks}
{"type":Rabbit, "quality":Hoppy}
{"type":Pig, "quality":Chubby}
{"type":Red Panda,…

skinneejoe
- 3,921
- 5
- 30
- 45
7
votes
1 answer
ArangoDb - How to count number of filtered results before limiting them
db.query(aql `
FOR doc IN ${collection}
FILTER REGEX_TEST(CONCAT(VALUES(doc, true)), ${queryStr}, true)
SORT doc[${sortBy}] ${dir}
LIMIT ${start, count}
RETURN doc._key
`)
.then(cursor => {
…

Yuvaraj V
- 1,020
- 2
- 16
- 28
7
votes
1 answer
ArangoDB - how to implement a custom recommendation engine using graph?
Lets say we have a database of food items such as:
item1 = {name: 'item1', tags: ['mexican', 'spicy']};
item2 = {name: 'item2', tags: ['sweet', 'chocolate', 'nuts']};
item3 = {name: 'item3', tags: ['sweet', 'vanilla', 'cold']};
And we have a user…

Stan Lee
- 117
- 5
7
votes
2 answers
Randomly select a document in ArangoDB
Is there a way to randomly return a document from a collection using AQL?
I would like to create a random graph for testing purposes.
I have not yet figured out how to select documents at random from the collection.
I was hoping I might be able to…

mikewilliamson
- 24,303
- 17
- 59
- 90
7
votes
1 answer
How receive over 1000 documents from ArangoDB collection?
I have a collection. My collection has 30 000 000 documents. I want to receive all its by means AQL query. I do so:
FOR c FROM MyCollection
SORT c.value ASC LIMIT 30000000
RETURN c.id
But I receives no more 1001 documents. Why?

jonua
- 1,915
- 3
- 17
- 27
6
votes
1 answer
ArangoDB / AQL Update Nested Documents
Given the following document structure:
{
"_key": "abc",
"_id": "abc",
"label": "Company ABC",
"departments": [
{
"name": "Department 123",
"id": "123"
},
{
"name": "Department 456",
"id": "456"
}
…

Leia
- 94
- 3
- 14
6
votes
1 answer
Arangodb update properties depend on edge type
I am trying to use AQL to update the whole node collection , named Nodes, depend on the type of edges they have
.
Requirement:
Basically, if 2 entity in Nodes has relation type= "Same", they would be updated with unique groupid properties (same for…

Loredra L
- 1,485
- 2
- 16
- 32
6
votes
1 answer
ArangoDB: Insert as function of query by example
Part of my graph is constructed using a giant join between two large collections, and I run it every time I add documents to either collection.
The query is based on an older post.
FOR fromItem IN fromCollection
FOR toItem IN toCollection
…

Nate Gardner
- 1,577
- 1
- 16
- 37
6
votes
1 answer
ArangoDB: Aggregating counts via graph traversal
In my ArangoDB graph, I have a subject, message threads associated with that subject, and messages inside those message threads. I would like to traverse the graph in such a way that I return the data associated with the message thread as well as…

Nate Gardner
- 1,577
- 1
- 16
- 37
6
votes
3 answers
INTERSECTION of (n) arrays in ArangoDB AQL
The scenario is this: I have an ArangoDB collection containing items, and another collection containing tags. I am using a graph, and I have an edge collection called "Contains" connecting the items and tags. An item has multiple tags.
Now I am…

Joachim Bøggild
- 614
- 5
- 15