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?
TextP.regex can be used, something like g.V().has("name", TextP.regex("(?i)^(vadas|josh)$"))...
Jump to solution
VKValentyn Kahamlyk9/26/2023
TextP.regex can be used, something like g.V().has("name", TextP.regex("(?i)^(vadas|josh)$"))
I think it's also worth adding that fairly soon the number of built in string manipulation functions that Gremlin supports will be increased and among those will be functions that support case insensitive operations. For right now, without falling back to closures, the regex step probably is the one to look at.
Sounds good. Thanks to both of you.

Looking for more? Join the community!

Want results from more Discord servers?
Add your server
Recommended Posts
project("p").by(__.values("a", "b") Only Outputs Single Property, Bug or Expected?I am curious why this does not behave in the way I expected. Not a problem - solution question. I Use of by()Can somebody explain the usecase of by() function in gremlin in very simple language.@GremlinDSL support in the GremlinLangScriptEngineHi, I recently sent a pull-request into the github ArcadeDB repository to add support binding custoRepeatStep does not appear to respect barriersI was digging into some traversal performance and had something similar to the following: ``` g.V(<Trying to find a Vertex using a variable injected earlier in the traversalI am trying to add a series of vertices and edges to an existing graph. The newly created Vertex wiDoes Gremlin support API for CRUD operations?Currently using g.V() for read and g.addV() for write.Individual Vertex per property or Vertex with grouped propertiesI'm building an identity graph that also stores User profile data - things like email address, phoneFilter out empty resultsgremlin> g.V().hasLabel('metadata').valueMap() ==>{} ==>{} ==>{oncall_roster=[oncall_schedule]} HowQuestion on running queries in windows env.I get an error `RuntimeError: Event loop is closed`, but after troubleshooting I notice that my scriPropertiesStep.hashcode() not always uniqueAs background... We're working with Gremlin (groovy) to write queries against an in memory graph modConditionally update one vertex property when another property matches a certain provided value to run a local version for a test, what is the correct serializer?Windows machine, local host. I can't find the Running this,