Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Neo4php 中创建如下关系
$src->relateTo($dst, 'FRIENDS') ->setProperty('duration', '5') ->save();
我希望这种关系是无向的而不是有向的。如果我没记错的话,我们可以在 Cypher 中做到这一点
create n-[:FRIENDS]-m
对比
create n-[:FRIENDS]->m
在 Neo4jphp 中怎么样?我们可以将“relateTo”设置为双向关系吗?
Neo4j 不支持无向关系。你所要求的是不可能的。为什么你想要无向的关系?如果该方向对您的域没有意义,只需任意选择一个方向,并在遍历或查询时忽略它。