You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过ArangoDB的HTTP接口查询指定数据库下的所有可用集合

ArangoDB HTTP接口导出操作说明

1. 获取指定数据库下的所有集合

访问指定数据库的资源需要在接口路径前缀添加/_db/目标数据库名称,查询test库下所有集合的命令如下:

curl http://localhost:8529/_db/test/_api/collection

如果需要过滤系统内置集合,添加excludeSystem=true参数即可:

curl http://localhost:8529/_db/test/_api/collection?excludeSystem=true

返回结果中的result数组即为该库下所有集合的元数据,包含集合名称、类型等核心字段。

2. 导出指定集合的全部数据

根据数据量大小可选择两种导出方式:

  • 小数据量(万级及以下):直接调用document接口批量拉取,以test库下users集合为例:
curl http://localhost:8529/_db/test/_api/document/users?onlyget=true
  • 大数据量:使用export端点流式导出,避免内存溢出,示例如下:
curl -X POST http://localhost:8529/_db/test/_api/export \
  -H "Content-Type: application/json" \
  -d '{"collection": "users", "flush": true}'

注意事项

如果你的ArangoDB服务开启了身份认证,需要在curl命令中添加-u 用户名:密码参数,示例:

curl -u root:你的密码 http://localhost:8529/_db/test/_api/collection

内容的提问来源于stack exchange,提问作者CoopDaddio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.25 08:45:05