Is it possible to run a case-insensitive cypher query on neo4j?
Try that: http://console.neo4j.org/
When I type into this:
start n=node(*) match n-[]->m where (m.name="Neo") return m
it returns one row. But when I type into this:
start n=node(*) match n-[]->m where (m.name="neo") return m
it does not return anything; because the name is saved as "Neo". Is there a simple way to run case-insensitive queries?
Yes, property values are case sensitive.
The Cypher query language depicts patterns of nodes and relationships and filters those patterns based on labels and properties. Cypher's syntax is based on ASCII art, which is text-based visual art for computers.
The WITH clause allows query parts to be chained together, piping the results from one to be used as starting points or criteria in the next. It is important to note that WITH affects variables in scope. Any variables not included in the WITH clause are not carried over to the rest of the query.
collect() The function collect() returns a single aggregated list containing the values returned by an expression. Returns: A list containing heterogeneous elements; the types of the elements are determined by the values returned by expression . An expression returning a set of values.
Yes, by using case insensitive regular expressions:
WHERE m.name =~ '(?i)neo'
https://neo4j.com/docs/cypher-manual/current/clauses/where/#case-insensitive-regular-expressions
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