开发者

How to customize the two variables of the FIND PATH statement in NebulaGraph Database?

开发者 https://www.devze.com 2022-12-07 21:10 出处:网络
The statement is like below: $src=lookup on table where table.table_name == "da_pubdata_bline_stat_df" ; $dst=lookup on table where table.table_name == "da_pubtb_opt_di" ; FIND sho

The statement is like below:

$src=lookup on table where table.table_name == "da_pubdata_bline_stat_df" ; $dst=lookup on table where table.table_name == "da_pubtb_opt_di" ; FIND shortest PATH WITH PROP FROM $src TO $dst OVER * BIDIRECT;

If I want to find the vid of the table vertex t开发者_JS百科hrough the table property, and then insert the queried value into the FIND statement to query the path between the two tables. I have written the statement like above, but it gives failed hint. How should the grammar be written?

Checked every detail of the statement and found nothing wrong. Expect to know why the statement I write is wrong.


You could either do so with variables like this(to specify the varible with dot):

$v1=lookup on table where table.table_name == “da_pubdata_bline_stat_df” yield id(vertex) as src
$v2=lookup on table where table.table_name == “da_pubtb_opt_di” yield id(vertex) as dst;
FIND shortest PATH WITH PROP FROM $v1.src TO $v2.dst OVER * BIDIRECT;

Or, alternatively, use cypher multiple MATCH(to get start and end node first) together with the shortestPath function.

The shortestPath expression is like:

MATCH p = shortestPath((a:player)-[e:follow*..2]-(b:player))\
        WHERE a.player.age >  45 AND b.player.age < 30 \
        RETURN p;
0

精彩评论

暂无评论...
验证码 换一张
取 消