Skip to content

Instantly share code, notes, and snippets.

@andreasronge
Created October 3, 2012 13:40
Show Gist options
  • Save andreasronge/3826953 to your computer and use it in GitHub Desktop.
Save andreasronge/3826953 to your computer and use it in GitHub Desktop.
me = lookup('node_auto_index', 'name', "Joe").as(:me)
me > rel(:favorite) > node(:myFavorites) > rel(:tagged) > node(:tag) < rel(:tagged) < node(:theirFavorites) < rel(:favorite) < node(:people)
me != node(:people)
ret node(:people)[:name].as(:name), count.desc.as(:similar_favs)
lookup('node_auto_index', 'name', "Joe").where_not{|m| m == node(:people)} > rel(':favorite') > node(:myFavorites) > rel(':tagged') > node(:tag) < rel(':tagged') < node(:theirFavorites) < rel(':favorite') < node(:people).ret(node(:people)[:name].as(:name), count.desc.as(:similar_favs))
a > :friends > node
a.outgoing(:friends)
me = Neo4j::Node.load(42) # find a node by id
me.outgoing(:knows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment