[英]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?将 TinkerPop Gremlin 与 Neptune DB 一起使用,有没有办法从突变中获得“结果”? The iterate()
returns GraphTraversal<S, E>
, but is there a way to determine success/fail? iterate()
返回GraphTraversal<S, E>
,但是有没有办法确定成功/失败? Or do we just assume success if there was no exception thrown?或者如果没有抛出异常我们就假设成功了吗?
The iterate
step has an implicit call to none
, which returns no results. iterate
步骤有一个对none
的隐式调用,它不返回任何结果。
If the mutation query has results, perhaps try using toList
instead.如果变异查询有结果,也许可以尝试使用toList
代替。 All queries are ACID transactions, so they will either complete (and commit) or fail and throw an exception.所有查询都是 ACID 事务,因此它们要么完成(并提交)要么失败并抛出异常。 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.因此,如果没有抛出异常,您可以假设成功,但如果您想看到一些结果,使用toList
终止查询可能是最好的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.