go from 0 over edge_mobile bidirect yield edge_mobile._src as vs_src ,edge_mobile._dst as v1_dst | go from $-.v1_dst over edge_mobile reversely yield $-.vs_src,$-.v1_dst,edge_mobile._dst;
你好,根据上述的建模和需求描述,想问一下对于 order1->mobile1<-order2->mobile2<-order3 的情况,你能否接受结果集中同时含有 order1, order2, order3 的情况。因为在根据 mobile 查询 order 的 2 度查询时,返回的结果集中会包含第一次的起点 order1,即:
GO FROM order1_id OVER edge_mobile YIELD edge_mobile._src AS src, edge_mobile._dst AS dst \
| GO FROM $-.dst OVER edge_mobile REVERSELY YIELD edge_mobile._dst AS dst
GO FROM order1_id OVER edge_mobile YIELD edge_mobile._src AS src, edge_mobile._dst AS dst \
| GO FROM $-.dst OVER edge_mobile REVERSELY WHERE edge_mobile._dst NOT IN collect($-.src) \
YIELD edge_mobile._dst AS dst
GO FROM order1 OVER edge_mobile YIELD edge_mobile._src AS src, edge_mobile._dst AS dst \
| GO FROM $-.dst OVER edge_mobile REVERSELY \
YIELD $-.src AS o1, $-.dst AS m1, edge_mobile._dst AS o2
如果只是统计行数的话,可以使用 YIELD COUNT(*) 类似:
GO FROM order1 OVER edge_mobile YIELD edge_mobile._src AS src, edge_mobile._dst AS dst \
| GO FROM $-.dst OVER edge_mobile REVERSELY \
YIELD $-.src AS o1, $-.dst AS m1, edge_mobile._dst AS o2 \
| YIELD COUNT(*) AS count
go from 0 over edge_mobile yield edge_mobile._src as tag_o1,edge_mobile._dst as tag_p1 | \
go from $-.tag_p1 over edge_mobile REVERSELY yield $-.tag_o1 as tag_o1,edge_mobile._src as tag_p1,edge_mobile._dst as tag_o2 | \
go from $-.tag_o2 over edge_mobile yield $-.tag_o1 as tag_o1,$-.tag_p1 as tag_p1,edge_mobile._src as tag_o2 ,edge_mobile._dst as tag_p2 | \
go from $-.tag_p2 over edge_mobile REVERSELY yield $-.tag_o1 as tag_o1,$-.tag_p1 as tag_p1,$-.tag_o2 as tag_o2,edge_mobile._src as tag_p2,edge_mobile._dst as tag_o3 | \
yield count(*) as count;