【发布时间】:2019-05-27 14:27:28
【问题描述】:
以下示例不适用于我在 Node.js 中使用 'gremlin' 3.4.1 npm 包:
g.V().has('person','name','bill').tryNext().orElseGet{g.addV('person').property('name','bill').next()}
我收到一个 TypeError 说 tryNext() 不是函数。我做错了什么?
import {driver, structure} from 'gremlin';
import DriverRemoteConnection = driver.DriverRemoteConnection;
import Graph = structure.Graph;
const g = new Graph().traversal().withRemote(new DriverRemoteConnection('ws://localhost:8182/gremlin'));
console.log(g.V().toList()); <= working
现在在该代码中使用上面的行将不起作用,但使用 Gremlin 控制台可以工作。
【问题讨论】: