Skip to content

Instantly share code, notes, and snippets.

@okram
Created July 29, 2014 22:15
Show Gist options
  • Save okram/f5f39b1facd64d1db994 to your computer and use it in GitHub Desktop.
Save okram/f5f39b1facd64d1db994 to your computer and use it in GitHub Desktop.
~$ gremlin
\,,,/
(o o)
-----oOOo-(_)-oOOo-----
gremlin> g = new TinkerGraph()
==>tinkergraph[vertices:0 edges:0]
gremlin> (0..10).each{g.addVertex([name:it])}
==>0
==>1
==>2
==>3
==>4
==>5
==>6
==>7
==>8
==>9
==>10
gremlin> // g.commit()
==>true
gremlin> g.V.name
==>3
==>2
==>10
==>1
==>0
==>7
==>6
==>5
==>4
==>9
==>8
gremlin> // g.rollback()
==>true
gremlin> g.V.sideEffect{it.name = it.name + '!!'}
==>v[3]
==>v[2]
==>v[10]
==>v[1]
==>v[0]
==>v[7]
==>v[6]
==>v[5]
==>v[4]
==>v[9]
==>v[8]
gremlin> // g.commit()
==>true
gremlin> g.V.name
==>3!!
==>2!!
==>10!!
==>1!!
==>0!!
==>7!!
==>6!!
==>5!!
==>4!!
==>9!!
==>8!!
gremlin> // g.rollback()
==>true
gremlin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment