Suppose there is a node, Student
, that has a property Name
.
MATCH (s:Student) were s.Name contains "stack"
RETURN s.Name
the output should be like : stack, Stack, STACK etc
Neo4j database is case sensitive. By default, property values are matched by Bloom in a case sensitive fashion, if they begin with any of the matching tokens input by the user. If you would like search suggestions to be case insensitive, you can enable Case insensitive search and suggestions under Bloom settings.
An OPTIONAL MATCH matches patterns against your graph database, just like a MATCH does. The difference is that if no matches are found, OPTIONAL MATCH will use a null for missing parts of the pattern. OPTIONAL MATCH could be considered the Cypher equivalent of the outer join in SQL.
The MATCH clause allows you to specify the patterns Neo4j will search for in the database.
With UNWIND , you can transform any list back into individual rows. These lists can be parameters that were passed in, previously collect -ed result or other list expressions. One common usage of unwind is to create distinct lists. Another is to create data from parameter lists that are provided to the query.
The regular expression operator, =~
, supports case insensitive searches via the (?i)
modifier.
This query is the equivalent of yours, except it is case insensitive:
MATCH (s:Student)
WHERE s.Name =~ '(?i).*stack.*'
RETURN s.Name
You can make the comparison on the upper/lower case version of each, for example:
MATCH (s:Student)
WHERE toLower(s.Name) CONTAINS toLower("stack")
RETURN s.Name
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