0

I want to check node exist or not before create a new node. From VivaGraph GitHub documentation I cant find anything.

1 Answers1

0

You can use

graph.getNode(id)

with graph being your VivaGraph instance, which would return null if no node with the given id exists. It is automatically called by graph.addNode(id, data), so it is not possible to create two nodes with the same id anyway.

MrFreeze
  • 185
  • 2
  • 8