I've now gone through exercise 8 up to 8.12 twice. The first time I would read an exercise then type out how I thought the answer should be formed, go to the next page (where the solution displays) and check to ensure what I wrote matched before playing it. The second time through, I didn't bother trying to type on my own, but just used the code in the exercises directly.
From the exercise:
MATCH (m:OlderMovie)
WHERE m.title = 'Forrest Gump'
RETURN m
What appears is a blank node - no label displays. Switch to table view, and the node clearly has the title in the list.
Replay the code as:
MATCH (m:Movie)
WHERE m.title = 'Forrest Gump'
RETURN m
Same thing displays - a blank node in graph view, but the title appears in table view.
Play as:
MATCH (m:OlderMovie)
WHERE m.title = 'Forrest Gump'
RETURN m.title
And the title displays in table view. Same with:
MATCH (m:Movie)
WHERE m.title = 'Forrest Gump'
RETURN m.title
What am I doing wrong?
I reset the database again and am going through by using the scripts in the exercises again.
Exercise 8.1:
CREATE (:Movie {title: 'Forrest Gump'})
Then Exercise 8.2 does show the title in graph view:
MATCH (m:Movie) WHERE m.title='Forrest Gump' RETURN m
Ran Exercise 8.11:
MATCH (m:Movie)
WHERE m.title = 'Forrest Gump'
SET m:OlderMovie,
m.released = 1994,
m.tagline = "Life is like a box of chocolates...you never know what you're gonna get.",
m.lengthInMinutes = 142
Ran Exercise 8.12:
MATCH (m:OlderMovie)
WHERE m.title = 'Forrest Gump'
RETURN m
The attached image shows the exercise results and my results. Hope this helps clarify.
Hi,
You are not doing anything wrong. This is a side-effect of the styes that Neo4j Browser uses for a node. Because this node has multiple labels, the style for it does not know what to use for the caption.
You can manually set what caption will appear for the OlderMovie style and see it it works, but there are some limitations with Neo4j Browser displaying multi-label nodes.
Elaine
1 Like