From my understanding of hasId step, it should be the same behavior to id().is() step. Which means the follow script should print the same result.
g.V().hasId(4)
g.V().id().is(4)
But unfortunately, the hasId() step seems not work as I expected, is there any something wrong from my side ? the whole script in below FYI.
gremlin> g.addV('Orange').property('price', '1.79').property('location', 'location-0').property('_classname', 'com.microsoft.spring.data.gremlin.common.domain.Orange')
==>v[4]
gremlin> g.V().id().is(0)
==>0
gremlin> g.V().id()
==>0
==>4
gremlin> g.addV('Orange').property('price', '1.79').property('location', 'location-0').property('_classname', 'com.microsoft.spring.data.gremlin.common.domain.Orange')
==>v[8]
gremlin> g.V().id()
==>0
==>4
==>8
gremlin> g.V().hasId(8)
gremlin> g.V().id().is(8)
==>8