Fook
Fook

Reputation: 5550

AWS Neptune: Custom vertex id in javascript

I'd like to specify my own vertex id's. According to the docs they are supported like so

g.addV().property(id, 'customid')

with no quotes around id. This causes JS to parse it as a variable, and it fails (undefined variable). Where do I import id?

Upvotes: 1

Views: 1122

Answers (1)

Kelvin Lawrence
Kelvin Lawrence

Reputation: 14371

try adding this to the code before you call the addV.

const { t: { id } } = gremlin.process;

That will correctly import id from gremlin.process for you.

Hope this help, Kelvin

Upvotes: 7

Related Questions