Do I understand this correctly: All you have is a single CSV as shown,
which is essentially one edge document per line? And no source file with
vertices?
If so, first correct your input data:
date,amount,name,_from,_to
25-02-2018,900.00,Ibrahim,5196030001,5196030002
26-02-2018,100.00,Angela,5196030002,5196030003
27-02-2018,100.00,Michael,5196030003,5196030004
28-02-2018,100.00,Tom,5196030004,5196030064
Note that there must not be whitespace around fields (i.e. no spaces in
front of _from and _to in the header, nor the customer identifiers), or you
will run into this error:
WARNING at position 0: creating document failed with error 'edge attribute
> missing or invalid', offending document: {"_from":"Customer/
> 5196030001" ...
Also note that leading zeroes will be lost:
28-02-2018,100.00,Tom,01234,001234
The numbers 01234 and 001234 will both end up as Customer/1234. If this is
undesired, wrap the fields in quote marks to preserve the leading zeroes:
28-02-2018,100.00,Tom,"01234","001234"
Now import your file into an *edge* collection (--create-collection-type
edge) and provide the vertex collection names as prefixes:
arangoimp --file "C:\ArangoDB\Deposit.csv" --type csv --collection
"CustomerFromTo" --server.username root --server.password 112233
--create-collection
true --create-collection-type edge --from-collection-prefix "Customer" --to
-collection-prefix "Customer"
Then create a document collection called Customer (e.g. via the web
interface) and generate the vertices with an AQL query:
FOR edge IN CustomerFromTo
FOR id IN [edge._from, edge._to]
COLLECT unique_id = id
INSERT { _key: PARSE_IDENTIFIER(unique_id).key } INTO Customer
--
You received this message because you are subscribed to the Google Groups
"ArangoDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.