在旧版本的 AgensGraph 上使用属性约束是不可能的。
考虑升级版本的AgensGraph。
agens (AgensGraph 2.1.0, based on PostgreSQL 10.4)
Type "help" for help.
agens =# match p = shortestpath( (l1:l{id:1})-[:e*]->(l2:l{id:11111}) ) return nodes(p);
nodes
----------------------------------------------------------------------------------------------------
[l[4.1]{"id": 1},l[4.10]{"id": 11},l[4.91]{"id": 111},l[4.820]{"id": 1111},l[4.7381]{"id": 11111}]
(1 row)
如果不可能,请使用“WHERE”子句代替属性约束。
agens (AgensGraph 1.3.1, based on PostgreSQL 9.6.2)
Type "help" for help.
agens =# match p = shortestpath( (l1:l)-[:e*]->(l2:l) ) where l1.id = 1 and l2.id = 11111 return nodes(p);
nodes
----------------------------------------------------------------------------------------------------
[l[4.1]{"id": 1},l[4.10]{"id": 11},l[4.91]{"id": 111},l[4.820]{"id": 1111},l[4.7381]{"id": 11111}]
(1 row)