Fetching hotels

Hotels can be found on the basis of which airport are they connected to, as shown in the following query:

neo4j-sh (?)$ MATCH (airport:Airport)-[:HAS_HOTEL]->(hotel:Hotel) 
WHERE airport.code IN ["JFK", "LAX"]
RETURN airport.code, hotel.name, hotel.price;

The output of the preceding query is as follows:

+-----------------------------------------------------+
| airport.code | hotel.name             | hotel.price |
+-----------------------------------------------------+
| "JFK"        | "Hampton Inn"          | 70          |
| "JFK"        | "Fairfield Inn"        | 80          |
| "LAX"        | "LAX South Travelodge" | 93          |
| "LAX"        | "Sheraton"             | 170         |
| "LAX"        | "Concourse"            | 100         |
+-----------------------------------------------------+
5 rows

Although we can find hotels while searching for flights, ...

Get Neo4j Graph Data Modeling now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.