Search code examples
orientdbgremlin

Gremlin: toLowerCase() not working properly


I have a vertex called 'city' that has property [cityName] "Miami" and property [syonyms] "Miami^Magic City^Little Cuba".

The following query returns no results:

g.V().hasLabel('city').has('syonyms',filter{it.get().toLowerCase().contains('Miami')})

While this query gives me the results that I want:

g.V().hasLabel('city').has('syonyms',filter{it.get().toLowerCase().contains('miami')})

I thought that the "toLowerCase()" would convert "Miami" into all lower case, but it doesn't seem to be doing that. Any ideas?


Solution

  • Adding toLowerCase() at the end of the value within "contains" solved the issue.

    g.V().hasLabel('city').has('syonyms',filter{it.get().toLowerCase().contains('Miami'.toLowerCase())})