krlawrence / graph

Practical Gremlin - An Apache TinkerPop Tutorial
Apache License 2.0
836 stars 253 forks source link

Add example of using repeat() to add vertices #203

Closed krlawrence closed 9 months ago

krlawrence commented 4 years ago

Add an example showing how repeat steps can be used to create vertices. Useful when testing.

gremlin> g.inject(1).repeat(addV('test').property(id,loops())).times(5)
==>v[4]
gremlin> g.V().valueMap(true)
==>[id:0,label:test]
==>[id:1,label:test]
==>[id:2,label:test]
==>[id:3,label:test]
==>[id:4,label:test]