查询
g.V().
has('id', 1).
out('follows').
as('x').
out('knows').
as('y').
project('Name').
by(select('x').by('name'))
这里,我想在投影中使用合并,因为有些顶点的name属性不存在。
我尝试过,但是没有用,
by(coalesce(select('x').by('name'), constant('null'))
将by
更改为values
,它应该可以工作:
g.V().
has('id', 1).
out('follows').
as('x').
out('knows').
as('y').
project('Name').
by(coalesce(select('x').values('name'), constant('null')))