Neo4j入门课程首查询报错:查询需包含title属性
Hey there! Let's break down why that red error message is popping up even though your query returns valid results.
First, let's recap the query you're running:
match (:Person)-[r :ACTED_IN]->(:Movie) return r.roles
The Likely Cause: Neo4j Browser's Built-in Hint
That error is almost certainly a friendly (but slightly annoying) automated hint from the Neo4j Browser—not an actual syntax or logic error in your query.
Here's what's happening: The Browser recognizes you're interacting with Movie nodes, which typically use title as a core, meaningful identifier. Even though your query is focused on pulling the roles property from the ACTED_IN relationship, the Browser assumes you might have forgotten to include the movie's title to make your results more context-rich. It's trying to be helpful, not telling you your query is broken.
How to Verify This
Try modifying your query to include the Movie node's title and see if the red error disappears:
match (:Person)-[r :ACTED_IN]->(m:Movie) return r.roles, m.title
If the error vanishes, that confirms it's just the Browser's hint system doing its thing.
What You Can Do
- Ignore it: If you only need the
rolesdata, your original query is perfectly valid. The red message doesn't affect query execution or result accuracy. - Adjust Browser Settings: If these hints bother you, you can tweak Neo4j Browser's settings to disable certain automated suggestions (look for "Query Hints" or similar options in the Browser's settings menu).
内容的提问来源于stack exchange,提问作者Bob Folkerts

