How can i get node by propery value? I mean something like that: I'll tried
match (n) where has (n.name = 'Mark')
return n
But it's incorrect.
And also How can i find node with max property value. I have nodes with property "VIEWS" and i want see node with max views.
So close...
MATCH (n)
WHERE n.name = 'Mark'
RETURN n
It is better to include a node label if you have one that will serve to segregate your node from other nodes of different types. This way if you have an index on the name property and label combination you will get better search responsiveness. For instance, you can create the index...
CREATE INDEX ON :Person(name)
And then query with the Person
label.
MATCH (n:Person)
WHERE n.name = 'Mark'
RETURN n
Or alternatively you can query this way...
MATCH (n:Person {name:'Mark'})
RETURN n
To find the person with the most views...
MATCH (n:Person)
RETURN n, n.views
ORDER BY n.views desc
LIMIT 1
To find the most views without the person...
MATCH (n:Person)
RETURN max(n.views)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With