How to get several peak properties in Gremlin?

Say I have a vertex {first_name, last_name} in the graph database (Neo4j in this case).

I can get any of these properties by extracting them as follows

gv(1).first_name => John gv(1).last_name => Smith 

I can get all the properties by doing

 gv(1).map 

What I'm trying to understand is how to get several properties at the same time (concatenation properties), for example

 gv(1).some-magic-here => John Smith 
+4
source share
1 answer

This can be done using the conversion step.

transform {clos} emits a close result

So, answering the question:

 gv(1).transform{it.first_name + ' ' + it.last_name} => John Smith 
+7
source

Source: https://habr.com/ru/post/1400927/


All Articles