gremlin javascript can't collect the properties of a vertex
up vote
0
down vote
favorite
After inserting a vertex in amazon neptune , I get the an unique id . If I want to print out the properties of a vertex , I can do it easily in gremlin console
But in my node js app , if I try to do the same I can't get the properties of the vertex
Here is what I have done in javascript
const fetchPropertyByVertexId = async (vertexId) => {
console.log("requsting properties of vertex "+vertexId);
return await g.V(vertexId).properties();
}
and then , I call
fetchPropertyByVertexId(vertexId).then( property =>{
console.log(property);
});
And the output is
I am using this library to connect with amazon neptune .
How can I get property of a vertex , in key value pair , like I get it in gremlin console ?
graph-theory gremlin tinkerpop3 gremlin-server amazon-neptune
add a comment |
up vote
0
down vote
favorite
After inserting a vertex in amazon neptune , I get the an unique id . If I want to print out the properties of a vertex , I can do it easily in gremlin console
But in my node js app , if I try to do the same I can't get the properties of the vertex
Here is what I have done in javascript
const fetchPropertyByVertexId = async (vertexId) => {
console.log("requsting properties of vertex "+vertexId);
return await g.V(vertexId).properties();
}
and then , I call
fetchPropertyByVertexId(vertexId).then( property =>{
console.log(property);
});
And the output is
I am using this library to connect with amazon neptune .
How can I get property of a vertex , in key value pair , like I get it in gremlin console ?
graph-theory gremlin tinkerpop3 gremlin-server amazon-neptune
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
After inserting a vertex in amazon neptune , I get the an unique id . If I want to print out the properties of a vertex , I can do it easily in gremlin console
But in my node js app , if I try to do the same I can't get the properties of the vertex
Here is what I have done in javascript
const fetchPropertyByVertexId = async (vertexId) => {
console.log("requsting properties of vertex "+vertexId);
return await g.V(vertexId).properties();
}
and then , I call
fetchPropertyByVertexId(vertexId).then( property =>{
console.log(property);
});
And the output is
I am using this library to connect with amazon neptune .
How can I get property of a vertex , in key value pair , like I get it in gremlin console ?
graph-theory gremlin tinkerpop3 gremlin-server amazon-neptune
After inserting a vertex in amazon neptune , I get the an unique id . If I want to print out the properties of a vertex , I can do it easily in gremlin console
But in my node js app , if I try to do the same I can't get the properties of the vertex
Here is what I have done in javascript
const fetchPropertyByVertexId = async (vertexId) => {
console.log("requsting properties of vertex "+vertexId);
return await g.V(vertexId).properties();
}
and then , I call
fetchPropertyByVertexId(vertexId).then( property =>{
console.log(property);
});
And the output is
I am using this library to connect with amazon neptune .
How can I get property of a vertex , in key value pair , like I get it in gremlin console ?
graph-theory gremlin tinkerpop3 gremlin-server amazon-neptune
graph-theory gremlin tinkerpop3 gremlin-server amazon-neptune
edited Nov 7 at 20:19
Dominique Fortin
1,493816
1,493816
asked Nov 7 at 7:37
Mithun Sarker Shuvro
1,89152038
1,89152038
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
I think that you need to iterate your traversal. This:
return await g.V(vertexId).properties();
returns a Traversal
object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList()
:
return await g.V(vertexId).properties().toList();
Thanks a lot, it worked
– Mithun Sarker Shuvro
Nov 7 at 12:59
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
I think that you need to iterate your traversal. This:
return await g.V(vertexId).properties();
returns a Traversal
object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList()
:
return await g.V(vertexId).properties().toList();
Thanks a lot, it worked
– Mithun Sarker Shuvro
Nov 7 at 12:59
add a comment |
up vote
2
down vote
accepted
I think that you need to iterate your traversal. This:
return await g.V(vertexId).properties();
returns a Traversal
object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList()
:
return await g.V(vertexId).properties().toList();
Thanks a lot, it worked
– Mithun Sarker Shuvro
Nov 7 at 12:59
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
I think that you need to iterate your traversal. This:
return await g.V(vertexId).properties();
returns a Traversal
object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList()
:
return await g.V(vertexId).properties().toList();
I think that you need to iterate your traversal. This:
return await g.V(vertexId).properties();
returns a Traversal
object which does not return results - it just represents the object to iterate to get results. So, you need to include a terminal step like toList()
:
return await g.V(vertexId).properties().toList();
answered Nov 7 at 11:28
stephen mallette
24.2k32675
24.2k32675
Thanks a lot, it worked
– Mithun Sarker Shuvro
Nov 7 at 12:59
add a comment |
Thanks a lot, it worked
– Mithun Sarker Shuvro
Nov 7 at 12:59
Thanks a lot, it worked
– Mithun Sarker Shuvro
Nov 7 at 12:59
Thanks a lot, it worked
– Mithun Sarker Shuvro
Nov 7 at 12:59
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53185200%2fgremlin-javascript-cant-collect-the-properties-of-a-vertex%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password