O'Reilly logo

Learning Neo4j 3.x - Second Edition by Rik Van Bruggen, Jérôme Baton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

With a little help from my friends

Among the improvements that graph databases bring compared to relational databases is a usage typical for dating sites and recommendation sites (find the friend of a friend or contacts of your contacts).

To demonstrate this, we need a little more data in our graph. Let's consider this as a tree with three levels of Dude (a new Label). There are no identifiers here, thus no constraint, just a name property. We will use this notation dudeA1:Dude for the first (1) node of the first level, our starting point being (leBig:Dude). This dude will have three friends (on level B) called (dudeB1:Dude), (dudeB2:Dude), and (dudeB3:Dude), who will have four friends each on level C.

To create these nodes, a Cypher code ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required