Is it possible to create edges by specifying documents that may or may not exist, and create them when they don't?
For instance, if I run a query like:
INSERT {_to: 'docs/something', _from: 'docs/other'} IN edges
If either docs/something or docs/other don't exist already, I'll get an error. Is there an option I could pass that would create docs/something and docs/other (as an empty object, perhaps) if they didn't exist?
Note: I can do a bulk import and create edges without documents - _to and/or _from just lead to nowhere - but I'd rather create a blank document
One of the features of Managed Graphs is, that it ensures graph integrity. Thus using the edge management facility will end in ArangoDB not permitting the insertion of dangling edges.
However, ArangoDBs graph functionality is layered on top of document functionality. The document functionality does not warant graph integrity; thus inserting edges referencing non existant vertices is possible this way and your example query will work if the edge collection exists.
However, quoting the insert documentation:
So you won't be able to create vertices dynamically with AQL in the same query.
With ArangoDB 2.8 the vertex collection would have to exist first.