Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
升级到AnonymousTraversalSource(gremlin3.3.5+;Node.js)_Node.js_Lambda_Gremlin - Fatal编程技术网

升级到AnonymousTraversalSource(gremlin3.3.5+;Node.js)

升级到AnonymousTraversalSource(gremlin3.3.5+;Node.js),node.js,lambda,gremlin,Node.js,Lambda,Gremlin,我正在用Lamda Nodejs12.x编写代码 我想更新到不推荐的连接方式 const gremlin = require('gremlin'); const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection; const traversal = gremlin.process.AnonymousTraversalSource.traversal; const clusterEndpoint = process.en

我正在用Lamda Nodejs12.x编写代码

我想更新到不推荐的连接方式

const gremlin = require('gremlin');
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;
const traversal = gremlin.process.AnonymousTraversalSource.traversal;

const clusterEndpoint = process.env.CLUSTER_ENDPOINT;
const port = process.env.CLUSTER_PORT;

const connectionStrArray = [];
connectionStrArray.push("wss://");
connectionStrArray.push(clusterEndpoint);
connectionStrArray.push(":");
connectionStrArray.push(port.toString());
connectionStrArray.push("/gremlin");

let joinedConnection = connectionStrArray.join("")
console.log(joinedConnection)
let dc = new DriverRemoteConnection(joinedConnection);

const g = traversal().withRemote(dc)
然后一些
等待g.V().hasLabel
或类似产品

但我得到的只是:
无法读取未定义的属性“processor”

它与图(3.3.4)的旧方法一样工作良好

我做错了什么? 我错过了什么

更新

显然我需要添加travelsource

{traversalSource:'g'}

我找不到任何添加此内容的文档,仅对其进行了少量引用

更新2

对于懒惰的人:这是我得到的代码

const gremlin = require('gremlin');
const traversal = gremlin.process.AnonymousTraversalSource.traversal;
const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection;

const clusterEndpoint = process.env.CLUSTER_ENDPOINT;
const port = process.env.CLUSTER_PORT;

const connectionStrArray = [];
connectionStrArray.push("wss://");
connectionStrArray.push(clusterEndpoint);
connectionStrArray.push(":");
connectionStrArray.push(port.toString());
connectionStrArray.push("/gremlin");

const g = traversal().withRemote(new DriverRemoteConnection(connectionStrArray.join(""), { traversalSource: 'g' }));

同样的错误也发生在我身上:

TypeError: Cannot read property 'processor' of undefined
不需要traversalSource,具体解决方案是将空对象传递给DriverRemoteConnection的第二个参数:

const g = traversal().withRemote(new DriverRemoteConnection(process.env.DATABASE_URL_LOCAL, {}));
因此,问题似乎是gremlin客户端中缺少的内部空检查


当我更新gremlin服务器时,这种情况开始发生,我没有更改客户端上的任何内容,奇怪…

你认为有办法与开发人员或其他人核实一下吗?他们似乎有一个Jira,但只适用于“真正的bug报告”。现在我只想知道它是否是一个bug:D
const g = traversal().withRemote(new DriverRemoteConnection(process.env.DATABASE_URL_LOCAL, {}));