Introduction
Cypher is the most powerful tool in the hands of any graph database developer when it comes to Neo4j. Cypher is the de facto language for querying graphs and came into existence, because the Java API for Neo4j was considered too verbose and that of Gremlin too prescriptive. Cypher was designed to strike the right balance by being declarative and easy for those who come from a SQL background.
In this chapter, we will learn many recipes around the Cypher query language, which will be very helpful in dealing with the common graph problems, such as creating new nodes/relations, finding nodes and the shortest distance between the two nodes, and many others, which are required in our day-to-day life. For the sake of simplicity, we will use a graph of the United States airports and the different flights connecting them together.
The data for the following graph has been taken from the dataset Airline On-Time Performance and Causes of Flight Delays, which was released by Bureau of Transportation...