1

有没有办法在没有边缘的情况下制作任意 OrientDB 记录的副本?我修改了一个用于复制记录的原始命令(来自文档)并向其中添加了 fetchplan,但它不起作用(坦率地说,它看起来解析这个特定命令有问题,但希望我错了)

这个执行得很好,但边缘仍然存在:

insert into Test from select from Test where @rid=#102:119 fetchplan in_*:-2 out_*:-2

这给出了一个错误:

insert into Test from (select from Test where @rid=#102:119 fetchplan in_*:-2 out_*:-2)
com.orientechnologies.orient.core.command.OCommandExecutorNotFoundException: Cannot find a command executor for the command request: sql.(SELECT FROM Test WHERE @rid = #102:119 FETCHPLAN in_*:-2 out_*:-2)

也试过了

insert into Test content (select @this.toJSON('fetchPlan:in_*:-2 out_*:-2') from Test where @rid=#102:119)

但这也不起作用。有什么想法吗?我在东方 2.1.x

4

3 回答 3

2

作为解决方法,您可以将此 javascript 函数与一个参数 (id) 一起使用

var g=orient.getGraph();
var b=g.command("sql","select @this.toJSON('fetchPlan:in_*:-2 out_*:-2') as json from "+ id);
if(b.length>0){
    var query="insert into Test content " + b[0].getProperty("json") ;
    var myVertex=g.command("sql",query);
    g.commit();
    return myVertex;
}

使用以下命令

select expand(result) from (select yourFunction(#102:119) as result)
于 2016-02-15T14:29:59.010 回答
0

我试过你的查询,我有同样的问题。我以这种方式解决了它:

insert into Test from select <property-name> from Test where @rid=#102:119

如果您想将它与 fatchplan 一起使用,请尝试以下操作:

insert into Test from select <property-name> from Test where @rid=#102:119 fetchplan in_*:-2 out_*:-2

希望能帮助到你。

问候,

米凯拉

于 2016-02-08T14:00:33.707 回答
0

以下是如何选择没有传入或传出边的所有顶点 (V):

select from (select @this, bothE().size() as n from V) where n = 0
于 2016-02-06T18:24:13.813 回答