Michail Michailidis
Michail Michailidis

Reputation: 12191

how to get current timestamp in a gremlin traversal?

Is there a way to do something like that in Gremlin traversals?:

g.addV("User").property("createdDate",now())

this should create a Vertex of label User with a field createdDate containing current timestamp.

Thanks!

Upvotes: 3

Views: 1753

Answers (2)

Daniel Inbaraj
Daniel Inbaraj

Reputation: 908

You can try this,

g.addV("User").property("createdDate", new Date())

This will work in gremlin console.

Upvotes: 0

Neil Lamka
Neil Lamka

Reputation: 76

Try this

g.addV("User").property("createdDate",System.currentTimeMillis())

That worked for me on DSE Graph

Upvotes: 6

Related Questions