简体   繁体   English

ArangoDB REST Traversal返回无效的startVertex

[英]ArangoDB REST Traversal return invalid startVertex

I've been trying to do some simple traversal in python using the REST API: 我一直在尝试使用REST API在python中进行一些简单的遍历:

import requests

url = "http://localhost:8529/_api/traversal"
d = { "startVertex": 'V/62824208658', "graphName" : "G", "direction" : "outbound"}
r = requests.post(url, data = json.dumps(d))
print r.json()

But this what i get : 但这就是我得到的:

{u'errorMessage': u'invalid startVertex', u'errorNum': 1202, u'code': 404, u'error': True}

I am sure that the vertice and graph exist. 我确信顶点和图形存在。 I have created them, and connected the vertice to another one by hand using the graphical interface. 我创建了它们,并使用图形界面手动将顶点连接到另一个顶点。

Does anyone know why? 有谁知道为什么?

Cheers, 干杯,

Ok, i found the problem, you are working on a database test_db but your traversal request is adressing the (default) _system db. 好的,我发现了问题,你正在处理数据库test_db,但是你的遍历请求正在处理(默认)_system数据库。 Change the call to: 将通话更改为:

url = "http://localhost:8529/_db/test_db/_api/traversal"

And don't forget to define a direction ;) 并且不要忘记定义方向;)

Cheers 干杯

Florian 弗洛里安

The error message seems quite clear, i took a look at the implementation of traversal and it only returns this error when the vertex is not found in the database. 错误消息似乎很清楚,我看了一下遍历的实现,它只在数据库中找不到顶点时返回此错误。

Just to confirm, try GET http://localhost:8529/_api/document/V/62824208658 to check if your vertex exists 只是为了确认,尝试GET http://localhost:8529/_api/document/V/62824208658来检查你的顶点是否存在

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM