O'Reilly logo

Neo4j Cookbook by Ankur Goel

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

Network reachability with Neo4j

If you have visited any social website, it will show you your network reachability, such as 23,951,064 professionals in your network.

In this recipe, you will learn how to find all the nodes reachable in your network.

Getting ready

  1. Install Neo4j on your machine using steps in the earlier recipes.
  2. Use the following Cypher script to create the dataset for this recipe:
    CREATE
        (bradley:User {name:'Bradley', surname:'Green', age:24, city:'Los Angeles'}),
        (matthew:User {name:'Matthew', surname:'Cooper', age:36, city:'Los Angeles'}),
        (lisa:User {name:'Lisa', surname:'Adams', age:15, city:'New York'}),
        (annie:User {name:'Annie', surname:'Behr', age:25,})
     (disjoint:User{name:'Andy', surname:'Leone', age:47, city:'Los Angeles'}), ...

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