Skip to content

Instantly share code, notes, and snippets.

@okram
Created November 1, 2011 21:27
Show Gist options
  • Save okram/1331966 to your computer and use it in GitHub Desktop.
Save okram/1331966 to your computer and use it in GitHub Desktop.
Iterator<Vertex> itty = graph.getIndex(Index.VERTICES, Vertex.class).get("sav_id", 12345);
Vertex savNode;
if(itty.hasNext()) {
savNode = itty.next();
} else {
savNode = graph.addVertex(new HashMap(..)) // the map has the MUST_HAVE requirements
}
// do something with savNode
// to delete
graph.removeVertex(savNode);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment