1
votes

I am trying to fetch vertices that start with a specific prefixes in JAVA. I have used the between predicate. Is there a better way to do the same. For example if I need the vertices starting with 'a'. I would use

.has(label, propertyKey, P.between("a", "b"))

1

1 Answers

0
votes

Since the release of TinkerPop 3.4.0, Gremlin also supports simple text predicates

In this case, you should use startingWith.

.has(label, propertyKey, TextP.startingWith("a"))

example: https://gremlify.com/ad