Ned Lowe
Ned Lowe

Reputation: 301

custom id in gremlin_python

A custom id can be supplied to a new vertex at the Gremlin Console as follows:

gremlin> g.addV('person').property(id, 1234).next()
==>v[1234]

In the Java client it can be done as follows:

graph.addVertex(T.id, customId);

(Where T is org.apache.tinkerpop.gremlin.structure.T)

Is there an equivalent of T.id for gremlin_python to facilitate the above form?

Many thanks.

Upvotes: 4

Views: 1786

Answers (1)

stephen mallette
stephen mallette

Reputation: 46226

There is a T enum for Python at gremlin_python.process.traversal.T (source code)

Upvotes: 8

Related Questions