Judges whether a string contains another string.
- Expression:
<value1>
CONTAINS<value2>
- Operand: string
Constant
Example: Judge whether 'Graph Database' contains 'graph'
return "Graph Database@d134" contains "graph"
0
Function
Example: Convert 'Graph Database' to lowercase and judge whether it contains 'graph'
return lower("Graph Database@d134") contains "graph"
1
Alias
Example: Judge each row of an alias whether it contains 'graph'
uncollect ["Graph", "grAph", "graph"] as a
return a contains "graph"
0
0
1
Sample graph: (to be used for the following examples)
Run below UQLs one by one in an empty graphset to create graph data:create().node_schema("professor").node_schema("student")
create().node_property(@*, "age", int32).node_property(@*, "email", string)
insert().into(@professor).nodes([{_id:"P001",_uuid:1,age:53,email:"[email protected]"},{_id:"P002",_uuid:2,age:27,email:"[email protected]"}])
insert().into(@student).nodes([{_id:"S001",_uuid:3,age:27,email:"[email protected]"},{_id:"S002",_uuid:4,age:20,email:"[email protected]"},{_id:"S003",_uuid:5,age:25,email:"[email protected]"}])
Property
Example: Find nodes whose email contains 'ultipa'
find().nodes({email contains "ultipa"}) as n
return n{*}
|--------------- @professor --------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| P002 | 2 | 27 | [email protected] |
Example: Find nodes of @professor, whose email contains 'ultipa'
find().nodes({@professor.email contains "ultipa"}) as n
return n{*}
|--------------- @professor --------------|
| _id | _uuid | age | email |
|-------|-------|-------|-----------------|
| P002 | 2 | 27 | [email protected] |