I am trying to import two csv files into ArangoDB. One is created as document 'accounts' and the other as edge 'transactions'. For the accounts, it works. However, when importing the transactions data, errors occur. I try to import this csv file from my command prompt (windows 10) with the following code:
arangoimport --file transactions.csv --type csv --create-collection true -server.database AML --create-collection-type edge --collection transactions --translate "SENDER_ACCOUNT_ID =_from" --translate " RECEIVER_ACCOUNT_ID =_to"
In my data, the first row is the header, which includes TX_ID,SENDER_ACCOUNT_ID,RECEIVER_ACCOUNT_ID,TX_TYPE,TX_AMOUNT,TIMESTAMP,IS_FRAUD,ALERT_ID
. And my original data looks like this:
transactions
I know edges need _from and _to attributes. So, in my command line, I use "translate" to rename columns in the input file to _from and _to as the code above shows. But it still gives out the error message as follows:
missing '_from' or '_to' attribute, offending document:
{"TX_ID":17144,"_from":84,"_to":87, ... }
Could you please give me some hint what happen? I am struggling with this problem for hours and hours and have seen similar questions posted one month ago, but no answers. Hope someone could help me out. Thanks very much.
_from
and_to
are documents'_id
values. The record that thrown the error should then be something like{"_from": "accounts/54", "_to": "accounts/87"}
– gurisko