【发布时间】:2018-04-19 09:32:08
【问题描述】:
有一个新版本出来了,但是文档中缺少一个工作示例。
Github 门票:https://github.com/jbmusso/gremlin-javascript/issues/109
我一直试图让一个例子起作用。任何帮助表示赞赏:
gremlin-server: 3.3.2 配置 gremlin-server-modern.yaml
npm gremlin 库:3.3.2
import gremlin from 'gremlin';
import DriverRemoteConnection from 'gremlin/lib/driver/driver-remote-connection';
import { Graph } from 'gremlin/lib/structure/graph';
const graph = new Graph()
const g = graph.traversal().withRemote(new DriverRemoteConnection('ws://localhost:8182/gremlin', { mimeType: 'application/vnd.gremlin-v3.0+json' }));
const fetchById = async (id) => {
const result = await g.V(id).toList()
console.log(result);
}
const addUser = async (name) => {
const newVertex = await g.addV().property('name','marko').property('name','marko a. rodriguez').next()
console.log(newVertex)
}
addUser()
fetchById(0)
电流输出:
[]
{ value: null, done: true }
【问题讨论】:
标签: javascript gremlin gremlin-server