I'm seeing .project().by()
traversals returning {}
under Gremlin JS 3.4.0
. When I downgrade to 3.2.10
they work correctly.
gremlin> g.addV("trip").property(single, "trackName", "Ohio")
==>v[1]
In Gremlin JS `3.4.0`:
const result = await g.V("1").project("trackName").by("trackName").next();
result:
{
"value": {},
"done": false
}
but when I downgrade to Gremlin 3.2.10
the result is correct:
{
"value": {
"trackName": "Ohio"
},
"done": false
}
Do I need to change how I use project
in 3.4.0
?
EDIT: Results from testing against different versions. I ran each test for a gremlin version, captured results, then bumped up the version and ran the tests again. I am only running a single Neptune instance so we can be sure this is the same data.
A failing test means it returned data in the form of:
"results": {
"value": {},
"done": false
}
For the console testing I removed the final .next()
.
The environment I am testing in is:
AWS Lambda Node 8.10
AWS Neptune 1.0.1.0
EDIT 2: Adding JS files used during Neptune test.
index.js
const gremlin = require("gremlin");
const { DriverRemoteConnection } = gremlin.driver;
const { Graph } = gremlin.structure;
const initGremlinClient = () => {
try {
const dc = new DriverRemoteConnection(
`ws://my-cluster.XXXXXXX.us-east-1.neptune.amazonaws.com:8182/gremlin`,
{}
);
const graph = new Graph();
return {
g: graph.traversal().withRemote(dc),
closeGremlinConnection: () => dc.close()
};
} catch (error) {
console.log("[GREMLIN INIT ERROR]", error);
throw new Error(error);
}
};
exports.handler = async event => {
const { g, closeGremlinConnection } = initGremlinClient();
const result = await g
.addV("test")
.property("myProp", "myValue")
.project("myProp")
.by("myProp")
.next();
closeGremlinConnection();
return result;
};
package.json
{
"name": "gremlinTest",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"dependencies": {
"gremlin": "3.4.0"
}
}