Home > Net >  Neo4j Query Not Returning Desired Output
Neo4j Query Not Returning Desired Output

Time:01-16

Hi I am learning Neo4j Database, I had an issue with one of the query as it seems to be not returning a valid output. Here is my complete dataset Dataset

Query that giving issue is MATCH (usr:USER)-[:KNOWS]->(lang:SKILL) where lang.name="Python" AND lang.name="FastAPI" return usr, Expected Output is Vibhav Node. But instead its not returning any valueenter image description here Please help me to understand this. Thanks in Advance!!

CodePudding user response:

You are setting two predicates on the same node, which will not work as a single node cannot have two names. What you need to do is:

MATCH (lang2:SKILL)<-[:KNOWS]-(usr:USER)-[:KNOWS]->(lang:SKILL) 
where lang.name="Python" AND lang2.name="FastAPI" 
return usr
  •  Tags:  
  • Related