Database Reference
In-Depth Information
single call—compared to the two separate calls demonstrated in the previous section with
the raw fine-grained API.
Listing 10.7. Using Cypher via REST API to get Adam's info, including all relationships
The benefit of using the Cypher endpoint is that you're able to aggregate and consolidate
the required data in a single execution, rather than requiring multiple individual network
calls. Although listing 10.7 returned the raw node and relationships data, you could easily
modify it to return only a subset of that data, reducing the size of the payload coming back
over the wire. You could choose to only return Adam's name, and the names of friends at
the end of his IS_FRIEND_OF relationships, with the following query:
MATCH ( x:Person { userId: { uId } } )-[r:IS_FRIEND_OF]-(y)
RETURN
 
Search WWH ::




Custom Search