arangodb - 如何使用_id将json文件导入/上传到arangoDB?
问题描述
我想导入我的 json 文件来创建一个集合。从我在下面尝试过的文档中,
arangoimp --file nodes.json --collection nodes --create-collection true
nodes.json
我的本地文件在哪里,nodes
是我的收藏。我可以毫无困难地成功完成这个过程。但它 arangoDB 自己创建它_id
。我想跳过这个过程。即,我想为_id
我的文档指定值。这个怎么做?
我尝试使用名称创建另一个字段_id
。但它没有创造任何东西(我认为_id
是保留字)。如何通过指定上传文件_id
是 arangoimp
解决方案
The _id
is a combination of the collection name and _key
and will be generated during import.
Use _key
in your json / json lines import file instead:
{ "_key": "IDDQD", "value": "James"}
{ "_key": "IDBEHOLDI", "value": 42}
Complete documentation, also how to specify an already existing ID as _key
(CSV import) could be found in the arangoimp documentation.
推荐阅读
- javascript - 根据条件使用 axios 和 promise 组合 2 个 json 数据集
- vue.js - ./resources/js/components/versionView.vue?vue&type=template&id=5700cc22 中的警告
- raspberry-pi - 如何将视频源帧发送到 ThingsBoard 小部件,而不从本地服务器请求它们?
- next.js - NextJS getInitialProps 返回 404 而不是使用 res.writeHead(302) 重定向
- c++ - 如何在 DLL 中使用 SetWindowsHookEx 和 WH_GETMESSAGE 来获取全局消息?使用 WH_GETMESSAGE 没有看到任何消息
- python - 如何在我的 Python 代码上添加线程?
- flask-sqlalchemy - SQL Alchemy 用户 <-> 客户关系,多对一,返回错误值
- assembly - MIPS 数组未存储正确的值
- javascript - 执行数组中的类实例方法(javascript)
- c# - 指针事件仅适用于 div 的一部分