aranGO
aranGO copied to clipboard
failed to relate: Unable to save document error
I cant persist a new entry into a edge-collection.
The result of a debug-session: we get 404
from http-rest-arango-endpoint.
I get the same error with the "relate-example" (README).
Hello @TobiEiss , I will check this. Thanks fro report. Which Arangodb version are you using? and wich aranGO version?
@diegogub arango version 3.1.1
And i found the Problem:
- The request-link is wrong (was right in an older version).
A little (dirty) workaround: instead of (README-example):
// Relate documents
s.DB("test").Col("ed").Relate(d1.Id,d2.Id,map[string]interface{}{ "is" : "friend" })
use:
edge := map[string]interface{}{}
edge["is"] = d1.ID
edge["friend"] = d2.ID
err := s.DB("test").Col("ed").Save(edge)
AND change in collection.go
(line 135)
if col.Type == 2 || col.Type == 3 {
I try'd this fix and get following :
session.go:129: -------------------------------------------------------------------------------- session.go:130: REQUEST session.go:131: -------------------------------------------------------------------------------- session.go:132:
session.go:133: Payload: session.go:134: { "friend": "docs1/196952", "is": "docs1/196948" } session.go:170: -------------------------------------------------------------------------------- session.go:171: RESPONSE session.go:172: -------------------------------------------------------------------------------- session.go:173: Status: 400 session.go:174: Header: session.go:175: { "Connection": [ "Keep-Alive" ], "Content-Length": [ "81" ], "Content-Type": [ "application/json; charset=utf-8" ], "Server": [ "ArangoDB" ] } session.go:176: Body: session.go:180: { "error": true, "errorMessage": "invalid edge attribute", "code": 400, "errorNum": 1233 } (newest arangodb version, with master and v2 branch of aranGO)
Ah, okay. My workaround is for master-branch
for me it did not work on master and v2 branch