In the previous lesson, you learned that the shortestPath() Cypher function will return the single shortest, unweighted path between two nodes.
The output of this function is a Path object, which you pass to the the length() function to find the length of the shortest path.
You will now use this knowledge to execute a Cypher query in the integrated Sandbox window to the right of the screen.
How many flights you have to take to get from BNA to HKT?
We are interested in finding the shortest path between Nashville (BNA) and Phuket (HKT) airports. You can filter nodes using the iata (airport code) property.
Replace the ??? in the query on the right of the screen to:
- 
Filter sourceandtargetnodes to BNA and HKT airports using theiataproperty.
- 
Update the shortestPathfunction to use a path betweensourceandtargetnodes via theHAS_ROUTErelationship.
The length function returns the length of the path (number of relationships).
Enter the length of the shortest path between BNA and HKT airports:
- 
✓ 3 
Hint
In the previous lesson, you reviewed this Cypher query that found the shortest path between the cities of Baltimore and Frankfurt:
MATCH (source:Airport {city:"Baltimore"}),
      (target:Airport {city:"Frankfurt"})
MATCH p = shortestPath((source)-[:HAS_ROUTE*1..10]->(target))
RETURN pSolution
The answer is 3.
You can use the following query to find the shortest route between Nashville (BNA) to Phuket (HKT):
MATCH (source:Airport {iata: 'BNA'}), (target:Airport {iata: 'HKT'})  
MATCH p=shortestPath((source)-[:HAS_ROUTE*]->(target))
RETURN length(p) AS resultSummary
In this challenge, you demonstrated your skills in finding the shortest unweighted path between two nodes.
In the next challenge, you will use the allShortestPaths() function to identify multiple shortest paths between nodes.