ArangoDB Query Language (or AQL) is a declarative querying language used inside the multi-model database ArangoDB.
Questions tagged [aql]
448 questions
3
votes
1 answer
How to group results in ArangoDb into single record?
I have the list of events of certain type, structured on the following example:
{
createdAt: 123123132,
type: STARTED,
metadata: {
emailAddress: "foo@bar.com"
}
}
The number of types is predefined (START, STOP, REMOVE...). Users produce…

igr
- 10,199
- 13
- 65
- 111
3
votes
1 answer
Which data type is arangodb storing auto-generated keys?
can anybody tell me which data type is arangodb storing his auto-generated _key's?
Is it number or string?
If i store a "foreign key" in a document from a dataset of antoher document, is it better for querys to store it as string or…

mok liee
- 217
- 2
- 10
3
votes
1 answer
How to merge all results of AQL into single document with custom properties
I have an AQL query traversing graph that always should return a fixed amount of documents from a unique set of collections.
So each collection will occur only once and with one document only.
I wish to merge them all into a single document under…

kuza
- 2,761
- 3
- 22
- 56
3
votes
1 answer
ArangoDB: AQL query to get all edges between two specific nodes
I have a document collection 'node' and an edge collection 'attribute'.
I am trying to get all edges in 'attribute' collection from: 'node/582148' to: 'node/582016'.
The simplest AQL query I've been able to devise is the following:
FOR v, e, p IN…

zra
- 141
- 1
- 13
3
votes
1 answer
Query from secondary index on aerospike
I'm considering aerospike for one of our projects. So I currently created a 3 node cluster and loaded some data on it.
Sample data
ns: imei
set:…

ivcode
- 235
- 2
- 14
3
votes
2 answers
AQL - Find documents with nonunique attributes in ArangoDB
Say I have the following documents:
{"_key": "1", "name": "George Washington"}
{"_key": "2", "name": "George Washington"}
{"_key": "3", "name": "John Adams"}
{"_key": "4", "name": "Thomas Jefferson"}
{"_key": "5", "name": "George…

Elias Strehle
- 1,722
- 1
- 21
- 34
3
votes
0 answers
make tree data structure from query in Arangodb
I have 2 collections:
root - vertices
root_edges - edges
Each root_edge connects 2 root documents. I want to be able to make a query so that it will return nested data structure representing the data tree.
I want something like this:
A: {
id:…

Quba
- 4,776
- 7
- 34
- 60
3
votes
1 answer
ArangoDB - Sort result in aql with custom function
I'd like to have sorted result depending on user input.
Lets say I have sort object that could look like this:
var sort = {createdAt: -1}
or like this:
var sort = {createdAt: 1, name: 1}
And I have query that looks like this:
FOR f in [{createdAt:…

MatiK
- 573
- 1
- 7
- 21
3
votes
1 answer
Structuring time-series data in ArangoDB
I have some time-series data (roughly on the order of 1-5 points per day) I need to be able to quickly access in a webapp using ArangoDB. The data is associated with a particular profile, but one collection is used for all the data for all profiles.…

Nate Gardner
- 1,577
- 1
- 16
- 37
3
votes
2 answers
ArangoDB: filter by collection type in a traversal query
I am using ArangoDB 2.8
I am doing a traversal query that includes 2 different collections. However in my result I would like to get only a particular collection, but I don't see the way to filter by collection name.
In my case I have address…

Dovi
- 833
- 1
- 10
- 29
3
votes
2 answers
Arangodb AQL recursive graph traversal
I have a graph with three collections which items can be connected by edges.
ItemA is a parent of itemB which in turn is a parent of itemC.
Elements only can be connected by edges in direction
"_from : child, _to : parent"
Currently I can get…

Alice Smith
- 81
- 1
- 9
3
votes
1 answer
ArangoDB : how to do a shortest_path filtering on edges
I'm using ArangoDB 3.0 and I want to create an AQL query to get the shortest path from A to B, with depth = 3, filtering on some edge properties.
The "ArangoDB 2.0" version of the query, would like be the following:
FOR e IN…

Daniele B.
- 105
- 8
3
votes
1 answer
invalid argument type in call to function 'ATTRIBUTES()' in ArangoDB
I have stored my Data in the give formate in AreangoDB, My collection name in DSP:
"data": {
"1": [ {"db_name": "DSP"}, {"rel": "2"} ],
"2": [ {"rel_name": "DataSource"}, {"tuple": "201"}, {"tuple": "202"}, {"tuple": "203"} ],
"201": […

Mrityunjay Singh
- 477
- 5
- 11
3
votes
1 answer
ArangoDB Graph-Traversal: Exclude Edges
I'm executing a query similar to:
FOR v, e IN 1..10 ANY @start GRAPH @graph
FILTER e.someCondition
RETURN v
What I expected to happen was that if e.someCondition was false, then the edge in question wouldn't be traversed (and transitively,…

thwd
- 23,956
- 8
- 74
- 108
3
votes
1 answer
Changing AQL so that sub-query result is flattened into two seperate arrays
This query works:
FOR person IN 1..1 INBOUND @companyID employed_by
LET age = DATE_DIFF(person.age * 1000, @currentTime * 1000, 'y')
COLLECT label = age WITH COUNT INTO value
RETURN {data: label, frequency: value}
And gives me…

IaMaCuP
- 835
- 5
- 19