boaol
boaol

Reputation: 108

About query in neo4j

I'm recently doing a project with neo4j and got a question about the query in neo4j.

can someone tell me the difference between the following queries

Match (u:User {username:"admin"}) return u

and

Match (u:User) where u.username = "admin" return u

they seem return the same result on my sample data

Upvotes: 1

Views: 36

Answers (1)

Dave Bennett
Dave Bennett

Reputation: 11216

If you PROFILE both queries you will see that they are literally the same; it is just two syntactically different ways of achieving exactly the same result.

PROFILE
MATCH (u:User {username:"admin"}) 
RETURN u

And ...

PROFILE
MATCH (u:User) 
WHERE u.username = "admin" 
RETURN u

Upvotes: 1

Related Questions