I have an array of usernames (eg. ['abc','def','ghi']
) to be added under 'user' label in the graph.
Now I first want to check if the username already exists (g.V().hasLabel('user').has('username','def')
) and then add only those for which the username property doesn't match under 'user' label.
Also, can this be done in a single gremlin query or groovy script?
I am using titan graph database, tinkerpop3 and gremlin REST server.
See Question&Answers more detail:os