Skip to content

Graph EdgeCollection edge add not working #19

@rosmo

Description

@rosmo

Looks like the API has been changed in ArangoDB, or something else is wrong. This should fix it:

--- graph.js.orig   2015-02-21 12:08:57.587976294 +0200
+++ graph.js    2015-02-21 12:10:41.895531469 +0200
@@ -127,11 +127,9 @@
   },
   save: function (data, fromId, toId, callback) {
     if (!callback) callback = noop;
-    this._gharial.post(data, {
-      collection: this.name,
-      from: this._documentHandle(fromId),
-      to: this._documentHandle(toId)
-    }, function (err, body) {
+    data['_from'] = this._documentHandle(fromId);
+    data['_to'] = this._documentHandle(toId);
+    this._gharial.post(data, function (err, body) {
       if (err) callback(err);
       else callback(null, body);
     });

There's probably other graph edge functions that are not working, but I haven't checked those.

Metadata

Metadata

Assignees

Labels

BugA code defect that needs to be fixed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions