Gao*_*Gao 6 gremlin tinkerpop tinkerpop3 janusgraph
我使用gremlin-console(janusgraph)远程连接到gremlin服务器,但是当我创建一个变量并访问它时,它不起作用.我的最终目标是使用gremlin-console创建索引...
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server -
[localhost/127.0.0.1:8182] - type ':remote console' to return to local mode
gremlin> a = "b"
==>b
gremlin> a
No such property: a for class: Script3
Type ':help' or ':h' for help.
Run Code Online (Sandbox Code Playgroud)
Flo*_*ann 14
您不能将这样的变量用于后续请求,因为默认情况下控制台是无会话的.因此,每个请求都在其自己的事务中执行,并且两个不同的请求之间不共享任何状态.
但是,您可以通过简单地将关键字附加到参数来配置控制台以使用会话:sessionconnect
gremlin> :remote connect tinkerpop.server conf/remote.yaml session
==>Configured localhost/127.0.0.1:8182-[15dc7030-0e5b-4b4b-a997-9d2cf519ebb2]
gremlin> :> x = 1
==>1
gremlin> :> y = 2
==>2
gremlin> :> x + y
==>3
Run Code Online (Sandbox Code Playgroud)
我从TinkerPop文档中复制了这个例子.
| 归档时间: |
|
| 查看次数: |
3249 次 |
| 最近记录: |