I would like to retrieve all the documents connected to the vertex. I was able to do it using two different queries as mentioned below.
First all my idea is to find a vertex by using the information stored in it. I was able to do it with a full text query:
FOR doc IN spec
FILTER doc.serial_no == '"12345abc"'
RETURN doc
RESULT
[
{
"_key": "3938424",
"_id": "spec/3938424",
"_rev": "_WP3-fvW---",
"type": "spec-type-545",
"name": "spec-name-957",
"serial_no": ""12345abc""
}
]
Then I used the spec ID to list all the documents attached to the vertex.By using the following query
FOR v IN 3 ANY 'spec/3938424'
belongs_to
RETURN v
RESULT:
[
{
"_key": "3937935",
"_id": "device/3937935",
"_rev": "_WQIeBTy---",
"type": "device-type-330",
"name": "Device iNH-SL",
"_children": 1,
"_parent": "unassigned"
}
]
Is it possible to combine the two queries into a single function.Like using the spec ID as a variable to feed into the next query. Is there any other option to do it.