Substring in Gremlin

326 megtekintés
Ugrás az első olvasatlan üzenetre

Vikram Shelke

olvasatlan,
2019. dec. 17. 5:47:252019. 12. 17.
– Gremlin-users
Hi Guys,

How can I substring the value return by my gremlin query in query itself?

Eg. String return by my query is like below,
/abcd/123/qwerty

I want data before second slash and after first slash in the output i.e abcd


Thanks in advance!

Stephen Mallette

olvasatlan,
2019. dec. 18. 6:38:192019. 12. 18.
– gremli...@googlegroups.com
There is no substring() in Gremlin at this time. You would have to use a lambda unfortunately:

gremlin> g.V().values('name').map{it.get().substring(1,2)}
==>a
==>a
==>o
==>o
==>i
==>e

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/d3c58c04-1ebc-4a9c-a8ab-4dec9890660f%40googlegroups.com.

Vikram Shelke

olvasatlan,
2019. dec. 18. 7:39:202019. 12. 18.
– Gremlin-users
Thanks Stephen.
Very useful!
Válasz mindenkinek
Válasz a szerzőnek
Továbbítás
0 új üzenet