Created
December 10, 2011 00:20
-
-
Save espeed/1453964 to your computer and use it in GitHub Desktop.
Gremlin Script Optimized for Script Engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
manager = g.getRawGraph().index() | |
index = manager.forNodes(index_name) | |
g.setMaxBufferSize(0) | |
g.startTransaction() | |
vertex = g.getRawGraph().createNode() | |
for (entry in data.entrySet()) { | |
if (entry.value == null) continue; | |
vertex.setProperty(entry.key,entry.value) | |
if (keys == null || keys.contains(entry.key)) | |
index.add(vertex,entry.key,entry.value) | |
} | |
g.stopTransaction(TransactionalGraph.Conclusion.SUCCESS) | |
return vertex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment