Search code examples
javagremlinamazon-neptunetinkerpop3

Get result from GraphTraversal operations with TinkerPop Gremlin and Java


Using TinkerPop Gremlin with Neptune DB, is there a way to get a "result" from a mutation? The iterate() returns GraphTraversal<S, E>, but is there a way to determine success/fail? Or do we just assume success if there was no exception thrown?


Solution

  • The iterate step has an implicit call to none, which returns no results.

    If the mutation query has results, perhaps try using toList instead. All queries are ACID transactions, so they will either complete (and commit) or fail and throw an exception. So if no exception is thrown, you can assume success, but if you want to see some results, terminating the query with toList is probably the best way.