Thanks for the explanation.
it's really quite easy once you become familiar with it
This was really my point. Things are always simpler when you're familiar with it and I happen to be very familiar with SQL. I just don't think ease should be a highlighted feature of NoSQL.
Don't get me wrong though. I use a few NoSQL systems in my company. But I didn't pick them because they were easy to understand.
This script will return a list of all the user's friends:
All you're doing is starting with the user node v(user_id) and following the outgoing links that are labeled "friend" to the adjacent nodes (the "incoming vertices").In a graph, each "edge" (each link) has an outgoing vertex and an incoming vertex. The outgoing vertex is where the edge starts from, and the incoming vertex is what the edge points to:
Here's a more concrete example... In this example, "james" is the outgoing vertex, "julie" is the incoming vertex, and they are linked together by an edge labeled "friend".Again "vertex" means the same thing as node so every user in the graph is a node (a vertex).