been playing around with cypher for a while now and having a bit of difficulty understanding something.
assuming i have person nodes some of which might have a belongs_to relationship what would be the best way to find a node that either
i have managed to create some queries that return the expected data, but i don't know if those are ones that are "correct" in the long run of my cypher understanding
any help would be appreciated. ( specifically with regards to And | Or , order and efficiency )
Use the IF function, one of the logical functions, to return one value if a condition is true and another value if it's false. For example: =IF(A2>B2,"Over Budget","OK") =IF(A2=B2,B4-A4,"")
Can you combine the IF function and the VLOOKUP function? Yes, you can, in fact, it is the easiest way to VLOOKUP using two or more conditions. To enter an array formula press and hold CTRL + SHIFT simultaneously, then press Enter once. Release all keys.
Something like this?
You can use path patterns as predicates, see: http://neo4j.com/docs/2.1.5/query-where.html#query-where-patterns
MATCH (n:Person {email:"[email protected]"})
WHERE NOT (n)-[:BELONGS_TO]->() OR (n)-[:BELONGS_TO {id:100})->()
RETURN n
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