I am writing an application that stores external data in ArangoDB for further processing inside the application. Let's assume I am talking about Photos
in Photosets
here.
Due to the nature of used APIs, I need to fetch Photosets
befor I can load Photos
. In the Photosets
API reply, there is a list of Photo
IDs that I later use to fetch the Photo
s. So I created an edge collection called photosInSets
and store the edges between Photosets
and Photos
, although the Photos
are not there yet.
Later on, I need to get a list of all needed Photo
s to load them via the API. All IDs are numeric. At the moment, I use the following AQL query to fetch the IDs of all required Photos
:
FOR edge
IN photosInSets
RETURN DISTINCT TO_NUMBER(
SUBSTITUTE(edge._from, "photos/", "")
)
However... this does not look like a nice solution. I'd like to (at least) get rid of the string operation to remove the collection name. What's the nice way to do that?