graph.addEdgeDefinition fails to add with no error when using async.each
This could be an issue on arangos api side, however when using the arango web ui it is possible to add a graph with multiple "from" and "to" properties.
When attempting this via the node driver, there is no error thrown but any definitions which have more than one "from" property do not appear in the graph.
Could you provide an example? You should be able to use multiple "from" properties by passing an array of values:
graph.addEdgeDefinition({
collection: 'foo',
from: ['a', 'b'],
to: ['c', 'd']
});
Also note that there can be only one edge definition per edge collection even if the collection is used in multiple graphs: https://docs.arangodb.com/HttpGharial/Management.html
It looks like the issue may not be related to multiple from properties and more related to the use of the async module adding multiple edge definitions to a single graph.
I have recently faced a similar issue with a single from edge and switching from async.each to async.eachSeries seems to make the the graph creation consistently add all edge definitions.
The problem with async.each vs async.eachSeries is likely that each performs the queries in parallel whereas eachSeries performs them (as the name indicates) in series. Normally this shouldn't be a problem but if you can replicate this problem outside the JS driver (e.g. by simply using async.each with the raw HTTP API, such as using request) you should probably file an issue with ArangoDB itself.