within() and case insensitive
I need to check if a property of a node is in a list of values. How can I do that in a case insensitive manner?
has('name',within('vadas','josh')) (+ case_insensitive?)
I can do that naughty step :
filter{ it.get().values('name').toLowerCase() in ['vadas', 'josh']; }
I guess I can also duplicate that 'name' and make another property with the lowercase version of 'name' so within works.
Any other suggestion?
has('name',within('vadas','josh')) (+ case_insensitive?)
I can do that naughty step :
filter{ it.get().values('name').toLowerCase() in ['vadas', 'josh']; }
I guess I can also duplicate that 'name' and make another property with the lowercase version of 'name' so within works.
Any other suggestion?
Solution
TextP.regex can be used, something likeg.V().has("name", TextP.regex("(?i)^(vadas|josh)$"))