Created
December 10, 2011 00:21
-
-
Save espeed/1453966 to your computer and use it in GitHub Desktop.
Gremlin Script Engine Request
This file contains 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
POST url: http://localhost:7474/db/data/ext/GremlinPlugin/graphdb/execute_script | |
POST body: {"params":{"keys":["name"],"index_name":"test_idxV","data":{"age":34,"name":"James Thornton"}},"script":"manager = g.getRawGraph().index()\nindex = manager.forNodes(index_name)\ng.setMaxBufferSize(0)\ng.startTransaction()\nvertex = g.getRawGraph().createNode()\nfor (entry in data.entrySet()) {\n if (entry.value == null) continue;\n vertex.setProperty(entry.key,entry.value)\n if (keys == null || keys.contains(entry.key))\n index.add(vertex,entry.key,entry.value)\n}\ng.stopTransaction(TransactionalGraph.Conclusion.SUCCESS)\nreturn vertex\n"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment