我正在使用 gremlin-javascript
,通过以下代码连接到远程服务器:
const gremlin = require('gremlin')
const Graph = gremlin.structure.Graph
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection
const graph = new Graph()
const g = graph
.traversal()
.withRemote(new DriverRemoteConnection('ws://localhost:8182/gremlin'))
通过gremlin命令行界面,我可以使用以下方式设置TinkerGraph
:
gremlin> graph = TinkerGraph.open()
gremlin> g = graph.traversal()
然而,我想连接到位于localhost:8182
的图形数据库。但这并不完全行得通:
gremlin> graph = RemoteGraph.open('ws://localhost:8182/gremlin')
这还不太对:
gremlin> graph = TinkerGraph.open()
gremlin> g = graph.traversal().withRemote(new DriverRemoteConnection('ws://localhost:8182/gremlin'))
我该如何从命令行连接到这个服务器?
控制台模式
。再次感谢! - user479947