ArangoDB 图数据库笔记

时间:2021-04-01 18:07:30
  1. ArangoDB 通过两个Document的Collection生成关系
    for m in meridians
    for p in acupoints
    filter p.Meridian == m.DisplayName
    insert {_from: p._id, _to:m._id, property:”12”} in Relations

  2. 将SQL数据库中导出的CSV文件导入到ArangoDB,每个表一个文件

#!/bin/sh 
# import CSV files data into arangoDB
# which name are like: `filename`.csv
# Noock Tian
# 2018-01-08

export CSV_FILES=`ls *.csv`
for f in $CSV_FILES
do
        export IFS='\`.'
        arr=($f)
        #echo @0=${arr[0]} @1=${arr[1]} @2=${arr[2]} @3=${arr[3]}
        export Table=${arr[1]}
        echo "importing $f ==> $Table ..."
        arangoimp --file "$f"  --type csv --collection $Table --create-collection true --server.database TCM --server.username Noock --server.password tdz

done