【问题标题】:How can i use limit(), valueMap() in gremlin orientdb api?如何在 gremlin orientdb api 中使用 limit()、valueMap()?
【发布时间】:2018-03-27 01:56:35
【问题描述】:

我已经安装了一个 orient db 分布式实例。我启动了 gremlin 控制台,打开了图表。

即使我可以按索引检索顶点,我也不能执行以下任一操作。

g.V().has('@class','user').limit(10)
g.V().has('@class','user').valueMap()
g.V().has('@class','user').select('user_name')

我收到以下错误

No signature of method: 
com.tinkerpop.gremlin.groovy.GremlinGroovyPipeline.limit() is 
applicable for argument types: (java.lang.Integer) values: [10]
Possible solutions: wait(), min(), last(), first(), 
getAt(java.lang.Integer), wait(long)

No signature of method: 
com.tinkerpop.gremlin.groovy.GremlinGroovyPipeline.valueMap() is 
applicable for argument types: () values: []

No signature of method: 
com.tinkerpop.gremlin.groovy.GremlinGroovyPipeline.select() is 
applicable for argument types: (java.lang.String) values: [user_name]
Possible solutions: select(), 
select([Lcom.tinkerpop.pipes.PipeFunction;), 
select([Lgroovy.lang.Closure;), select(java.util.Collection), 
select(java.util.Collection, [Lcom.tinkerpop.pipes.PipeFunction;), 
select(java.util.Collection, [Lgroovy.lang.Closure;)

【问题讨论】:

  • 您好,您使用的是哪个版本的orientdb?
  • 嗨。我正在使用 2.2.20

标签: orientdb gremlin orientdb2.2


【解决方案1】:

您正在混合版本。 Gremlin 的语法是 TinkerPop 3.x,但您显然没有使用支持该语法的 OrientDB TinkerPop 实现版本。如果要使用该语法,则需要使用:

https://github.com/orientechnologies/orientdb-gremlin

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-03
    • 1970-01-01
    相关资源
    最近更新 更多