ArangoDB数据导入

ArangoDB

ArangoDB是一个开源免费的多模型数据库,可以通过使用文档、图和键-值对来灵活的构建数据模型。使用c++编写,和其他的数据库或者图数据库的对比来说,ArangoDB的社区相对小了点,相关的资料很少,大部分都是在官方的文档和GitHub。据说它的速度比其他的图数据库快,不过就算再快,也要先把数据导进去才能测呢。

arangoimp

每当使用新的数据库时候,数据的导入都会是一个最先要处理的问题。只有把数据导入了数据,才能进行后续的操作。不过好在arangoDB提供了工具arangoimp来将处理好的csv,json,tsv文件导入到ArangoDB中。使用该命令可以批量导入数据到arangoDB,如果导入的是’edge’,那么_from和_to会默认被设置为索引。该命令的常用参数如下。

Usage: arangoimp [<options>]

Section 'global options' (Global configuration)
  --backslash-escape <boolean>           使用反斜线作为转意字符(default: false)
  --batch-size <uint64>                  每次数据量大小 (in bytes) (default: 16777216)
  --collection <string>                  要导入的集合名字 (default: "")
  --create-collection <boolean>          当集合不存在时创建集合 (default: false)
  --create-collection-type <string>      创建集合类型 (edge or document).(default:  "document")
  --file <string>                        导入文件名
  --from-collection-prefix <string>      _from 集合名前缀
  --overwrite <boolean>                  当集合已经存在时覆盖集合(default: false)
  --separator <string>                   字段分隔符,csv或tsv使用(default: "")
  --to-collection-prefix <string>        _from 集合名前缀
  --type <string>                        导入文件类型. possible values: "auto", "csv", "json", "jsonl", "tsv" (default: "json")

Section 'server' (Configure a connection to the server)
  --server.connection-timeout <double>   连接超时时间(default: 5)
  --server.database <string>             连接数据库名(default: "_system")
  --server.password <string>             连接密码. 如果没有特殊指定,需要使用密码,用户将被提醒索要一份密码(default: "")
  --server.request-timeout <double>      访问超时时间(秒) (default:1200)
  --server.username <string>             连接时用户名(default: "root")
原文地址:https://www.cnblogs.com/enhe/p/12141708.html