Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
orientDB查询中的$parent和$current_Orientdb - Fatal编程技术网

orientDB查询中的$parent和$current

orientDB查询中的$parent和$current,orientdb,Orientdb,我在orientDB文档中读到了它,但却找不到它。 如果有人能详细解释$parent和$current的用法,那就太好了。 在几个例子中,我尝试了$parent.$parent.$current和$parent.$current,它们都给出了我认为不应该出现的相同结果。以下是我的假设: $current允许访问当前正在处理的记录/节点 $parent允许访问正在处理的当前记录/节点的父级 你的第二个假设是错误的。它使您可以访问父查询的变量,这些变量在调用子查询时非常有用,如上所述 例如: cre

我在orientDB文档中读到了它,但却找不到它。 如果有人能详细解释$parent和$current的用法,那就太好了。 在几个例子中,我尝试了$parent.$parent.$current和$parent.$current,它们都给出了我认为不应该出现的相同结果。以下是我的假设:

$current允许访问当前正在处理的记录/节点 $parent允许访问正在处理的当前记录/节点的父级
你的第二个假设是错误的。它使您可以访问父查询的变量,这些变量在调用子查询时非常有用,如上所述

例如:

create class User extends V    
create class Follows extends E

create vertex User set name = 'u1'
create vertex User set name = 'u2'
create vertex User set name = 'u3'    

create edge Follows from (select from User where name = 'u1') to (select from User where name = 'u2')
create edge Follows from (select from User where name = 'u2') to (select from User where name = 'u3')


select $all from User
let $all = ( traverse out('Follows') from $parent.$current)

从select from user where name(如“%bob%”)中选择$all,让$all=从$parent.$current中遍历出“Follows”是否正确?未进行测试,但似乎没有问题。我有一个类似的查询,它仅在执行$parent.$parent.$current时有效。不确定为什么和$parent.$parent.$parent.$parent.$current?我猜基本查询是它自己的父查询。可能是我扩展太多了$父项。$parent。$parent。$current有效,但$parent。$parent。$parent。$parent。$current无效。太令人困惑了。