Gremlin drop()无法通过Java API工作 [英] Gremlin drop() isn't working via java api

查看:243
本文介绍了Gremlin drop()无法通过Java API工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用由本地dynamodb实例(使用3.0 tinkerpop堆栈)支持的titan db 1.0.0.我花了比想承认的更多时间来尝试弄清为什么drop()无法正常工作.在我的用例中,我试图删除通过遍历发现的特定边,但是即使graph.traversal().V().drop()也不起作用.我做了很多谷歌搜索,但也许没有使用正确的关键字.我终于弄清楚了我将在回答中指定的问题.希望其他人觉得这有用.

I'm using titan db 1.0.0 backed by a local dynamodb instance (which uses the 3.0 tinkerpop stack). I've spent more time than I'd like to admit trying to figure out why drop() wasn't working. In my use case I'm trying to remove a specific edge found via a traversal, but even graph.traversal().V().drop() wasn't working. I did much googling, but perhaps not with the right keywords. I finally figured out the issue which I'll specify in my answer. Hopefully others find this useful.

推荐答案

我终于想起在某处阅读过(不幸的是,现在我找不到共享链接的链接 edit :请参阅Stephen提供的链接Mallete),当在java-land中处理gremlin时,您需要显式地遍历遍历.

I finally remembered reading somewhere (unfortunately I can't find it now to share the link edit:see the link provided by Stephen Mallete), that when dealing with gremlin in java-land, you needed to explicitly iterate the traversal.

所以诀窍是graph.traversal().V().drop().iterate().请注意,使用gremlin控制台时(至少在3.0中)不需要此功能.您可以只使用graph.traversal().V().drop().

So the trick was graph.traversal().V().drop().iterate(). Note this is not needed when using the gremlin console (at least with 3.0). You can just use graph.traversal().V().drop().

这篇关于Gremlin drop()无法通过Java API工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆