Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
03-18-2020 01:16 PM
Hello everyone,
I want to make the following query but I get an error because of the type of f.synonyms (it is a StringArray):
MATCH (f:Family)-[:IS_PROVIDED]->(p:Provider)-[:OFFERS]->(pr:Product)
WHERE (f.name =~ '(?i)virtual server(?i).')
OR (toLower(f.name) CONTAINS toLower('virtual server'))
OR (f.synonyms =~ '(?i)virtual server(?i).')
OR (toLower(toString(f.synonyms)) CONTAINS toLower('virtual server'))
RETURN DISTINCT f.name AS Family
Is there any way how to change the type from StringArray to String in order to check if some phrase is contained or not???
03-19-2020 01:12 AM
Hi @busymo16,
Hope by StringArray you do not mean list. so example of StringArray is 'virtual server'
What kind of data you have in f.synonyms?
Are you just trying to find all the family for which f.name or f.synonyms contains 'virtual server'.
03-19-2020 09:40 AM
If by StringArray you mean a list of strings, then you can use predicate functions to test if any, all, or none of the elements in the list contains the phrase:
OR any(syn IN f.synonyms WHERE toLower(syn) CONTAINS 'virtual server')
All the sessions of the conference are now available online