Orientdb 何时使用展开()和/或子选择

Orientdb 何时使用展开()和/或子选择,orientdb,Orientdb,如果有人能向我解释以下三个问题之间的区别,以及为什么只有最后一个问题有效,我将不胜感激 select out() from #1:0 where @class instanceof 'BaseClass' select expand(out()) from #1:0 where @class instanceof 'BaseClass' select from (select expand(out()) from #1:0) where @class instanceof 'BaseClass'

如果有人能向我解释以下三个问题之间的区别,以及为什么只有最后一个问题有效,我将不胜感激

select out() from #1:0 where @class instanceof 'BaseClass'
select expand(out()) from #1:0 where @class instanceof 'BaseClass'
select from (select expand(out()) from #1:0) where @class instanceof 'BaseClass'

非常感谢你的帮助

因为where条件在前两种情况下没有很好地应用。 first one out()只返回记录id的集合, 在第二个例子中,数组在文档集合中展开和转换,但我认为在展开之前应用where条件,所以类似于案例1的情况不起作用

如果您不想使用子查询,您可以随时这样做

select expand(out()[ @class = 'BaseClass']) from #1:0

因为where条件在前两种情况下没有得到很好的应用。 first one out()只返回记录id的集合, 在第二个例子中,数组在文档集合中展开和转换,但我认为在展开之前应用where条件,所以类似于案例1的情况不起作用

如果您不想使用子查询,您可以随时这样做

select expand(out()[ @class = 'BaseClass']) from #1:0