【发布时间】:2018-03-13 10:18:35
【问题描述】:
我使用 javascript 函数添加了多个节点,并希望在尝试编写 for 循环时添加边来连接它们,它会引发以下异常:
com.orientechnologies.orient.core.exception.OSerializationException:无法序列化无效链接:#57:-2 在嵌入式会话中
如果我在没有 for 循环的情况下编写相同的查询,它将被执行。
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,[]);
}
【问题讨论】:
-
for 循环是否应该遍历 post_0、post_1 等?
-
是的,我已经上传了硬编码版本,它将是“post_” + i
标签: javascript orientdb graph-databases