【发布时间】:2017-07-26 12:35:20
【问题描述】:
我正在使用Neo4j gem,只有ActiveNode。我可以创建关系属性,但如何访问和更新它?
我可以使用 Neo4j::ActiveBase.current_session.query('Cypher Query') 将整个内容编写为密码查询
但是不使用cypher怎么写呢?
【问题讨论】:
标签: ruby-on-rails neo4j cypher
我正在使用Neo4j gem,只有ActiveNode。我可以创建关系属性,但如何访问和更新它?
我可以使用 Neo4j::ActiveBase.current_session.query('Cypher Query') 将整个内容编写为密码查询
但是不使用cypher怎么写呢?
【问题讨论】:
标签: ruby-on-rails neo4j cypher
如果您有一个 Person 模型与 friends 关联,您可以执行以下操作之一
Person.friends.each_rel do |rel|
end
Person.friends.each_rel.map do |rel|
end # or any other `Enumerable` method
Person.friends.each_rel.to_a
还有一个each_with_rel,它给出了节点和关系
【讨论】: