我有一个在Datastax Studio中使用Gremlin编写的查询,看起来像这样:
g.V().has('vertexLabel', 'vertexProperty1', '12345').match(
__.as('d').in('edgeLabel1').values('property2').as('NAME1'),
__.as('d').in('edgeLabel2').values('property3').as('NAME2'),
__.as('d').in('edgeLabel1').out('edgeLabel3').values('property4').as('NAME3')
).select('NAME1', 'NAME2', 'NAME3')
如果所有实体都存在,这样做就可以正常工作,但如果其中一个实体不在图形上,即使我知道有结果也无法找到。如何进行.or查询以查找存在的值。比如说,如果在edgeLabel3的结尾没有找到property4,我的查询仍然可以给我其他两个结果(property2和property3)吗?我尝试过进行.or查询,但没有成功。