Gremlin Python:属性存在性检查



我似乎无法找到一种惯用的方法来过滤具有或不具有特定属性(无论其值如何(的节点。

属性存在:

> g.V().hasNot('weight', None).toList()
*** gremlin_python.driver.protocol.GremlinServerError: 599: Could not locate method: DefaultGraphTraversal.hasNot([weight, null])

属性不存在:

> g.V().has('weight', None).toList()
*** gremlin_python.driver.protocol.GremlinServerError: 599: null:has([weight, null])

hasKey()未返回任何结果:

> g.V().hasKey('weight')

使用gremlin服务器3.3.4

哦,事实证明这很有效:

g.V().has('weight')

在文档中很难找到:http://tinkerpop.apache.org/docs/current/reference/#has-步进

最新更新