how to add multiple edges using javascript function in orientDB

34 views
Skip to first unread message

har...@volgainfotech.com

unread,
Mar 13, 2018, 9:46:19 AM3/13/18
to OrientDB
Hey

I have added multiple nodes using the javascript function and wish to add edges to connect them when I try to write a for loop, it throws the following exception: "com.orientechnologies.orient.core.exception.OSerializationException: Impossible to serialize invalid link :#57:-2 in embedded session"

If I write the same query without the for loop, it gets executed. Please Help.

var g = orient.getGraph();
for (var i = 0 ; i < 5 ; i ++ ){
var title ="post_0";
var company_name = "Company_0";
var c = "create edge HasInterest from (select from post where Title = '" + 
title + "') to (select from Interest where      Name = 'Recruitment')"; 
    g.command("sql",c,[]);
}

Reply all
Reply to author
Forward
0 new messages