简体   繁体   中英

how do I find related nodes given a node using Neography in neo4j?

The documentation doesn't seem to work as expected.

node
#<Neography::Node>>

node.outgoing
#<Neography::NodeTraverser:0x007f5981427f20

I just want to get the nodes for a given relationship, but it's unclear based on the current documentation:

https://github.com/maxdemarzi/neography

That syntax builds a traversal description until you are ready to .each it:

node.outgoing(:friends).depth(4).nodes.each do |node|
  puts node.map{|n| n.name }.join(' => friends => ')
end

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM