ArangoDB Query Language (or AQL) is a declarative querying language used inside the multi-model database ArangoDB.
Questions tagged [aql]
448 questions
0
votes
1 answer
AQL nested array values
I'm fairly new to ArangoDB and AQL and my question pertains to nested array values. I do not know if there is a way this can be done (or even if my query is efficiently written)
To keep this short, I have 2 collections. One for "Physicians" and one…

Alex J.
- 3
- 2
0
votes
3 answers
how to fetch data from two collection in arangodb
my project backend is arangodb. I have two collections named "test" and "demo". i need to fetch data from both these tables. my data is like this:
test
[
{
"firstName": "abc",
"lastName": "pqr",
"company": "abc Industries",
"id":…

Khushi
- 1,759
- 6
- 26
- 45
0
votes
1 answer
In ArangoDB how to select a node in graph filter by multi edge?
Data like this
a->b,c,d
b->c,d
d->a,b
Query like this
FOR n in Nodes
FOR v,e,p IN 1 ANY n GRAPH 'MyGraph'
// Only need a
// HOW TO WRITE: FILTER n have an edge to `b` and n have an edge to `d`
// This will select a,b,c
FILTER v._key in [ 'b', 'd'…

wener
- 7,191
- 6
- 54
- 78
0
votes
1 answer
Filter on multi path
Say, I have a graph with following relationship:
app
^
|
|
tomcat < ------------------
^ |
| |
| |
| |
nginx ----> varnish ----> lvs
I want to add a…

hughjfchen
- 21
- 2
0
votes
1 answer
Determining which unique constraint caused INSERT failure in ArangoDB
I have a document collection in ArangoDB that has multiple unique indexes. When inserting a new document, the insert could fail because of any of the unique indexes. Is there a way to easily figure out which field(s) in the document caused the…

NoSkills
- 1
- 2
0
votes
1 answer
Sort by Object Attributes in ArangoDB
I have a Collection that consists of objects, made from an integer/string as key/attribute and some value.
Like this:
results
-> '1' : 231.034
-> '2' : 3267.123
-> '3' : 235.23
When I write:
"""FOR u IN collection
RETURN u.results"""
I get them in…

Master117
- 660
- 6
- 21
0
votes
0 answers
Artifactory AQL not working with relative time parameters
This below AQL query works fine and gives me expected results but when I use time relateive time parameters as 2W 5d getting a 400 bad request.
items.find(
{
"repo": "test-repo",
"name" :{"$match": "*.13.4.*.*.nupkg"},
"created" :…

mamidala86
- 13
- 4
0
votes
1 answer
ArangoDB Unique Index Validation
Quick question: in ArangoDB, if I create a unique index (for example a unique hash index), does ArangoDB validate the uniqueness of that attribute, or just assume it because I told it it's unique? I'm curious if I should go through a validation step…

Nate Gardner
- 1,577
- 1
- 16
- 37
0
votes
1 answer
ArangoDB - Help on AQL Aggregation
I have a graph like this:
// [user] -answer-> [question]
for u in user
filter u._id in ['user/foo', 'user/bar']
for v, e in 1 outbound u graph 'qaGraph'
return keep(e, '_from', '_to', 'chosen')
Output:
[
{
"_from":…

André
- 12,497
- 6
- 42
- 44
0
votes
1 answer
ArangoDB Date Math - Month difference
Utilizing the DATE_SUBTRACT function in AQL, when handling dates near the end of the month, Arango seems to subtract 30 days instead of returning the actual previous month. e.g.:
for mo in 0..11
let month =…

Nate Gardner
- 1,577
- 1
- 16
- 37
0
votes
2 answers
Multiple sorting in ArangoDB
My webapp needs to display several sorted lists of document attributes in a graph. These are hours, cycles, and age.
I have an AQL query that beautifully traverses the graph and gets me all the data my app needs in 2 ms. I'm very impressed! But I…

Nate Gardner
- 1,577
- 1
- 16
- 37
0
votes
2 answers
AQL Arango - Get Vertex and Neighbors using Edges
Coming from neo4j and new to Arango.
I am trying to query my data and build a corresponding data structure.
So I have something like:
Circle A
/ \
Square A Circle B
/ \ \
Circle C Square B Square…

literallypenguin
- 121
- 10
0
votes
1 answer
Ideas to improve my AQL query
In my graph, a user is connected to many items and each item can be recursively divided into many sub-items. Since my items have a particular ordering, I'm considering these two options to model my data:
Now I want to create a query to retrieve two…

André
- 12,497
- 6
- 42
- 44
0
votes
2 answers
How we calculate distance between two co-ordinate. ArangoDB
I have a Users table that contains latitude and longitude attribute for every user. So I need to calculate the distance between two users in AQL Query.
I have done the same in Orientdb with the below query.
var laltitude =…

Lalit Kumar Maurya
- 5,475
- 2
- 35
- 29
0
votes
1 answer
Getting list of connected nodes for a given node in arangodb
I have constructed a graph in Arangodb.
I'm struggling to get the below requirement.
Given a node, and i need a list of all the nodes connected to it along with the depth it is connected to.
Example:
Customer2 -> connected to Customer1 at depth of…

mahi
- 59
- 3