You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Ben Smith (Jira)" <ji...@apache.org> on 2020/12/22 14:23:00 UTC
[jira] [Comment Edited] (TINKERPOP-2497) Gremlin JS Serializer
always empty [{}] with valueMap(), entitypMap()
[ https://issues.apache.org/jira/browse/TINKERPOP-2497?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17253507#comment-17253507 ]
Ben Smith edited comment on TINKERPOP-2497 at 12/22/20, 2:22 PM:
-----------------------------------------------------------------
Hello Stephen,
Thanks for the quick reply. I am using AWS Neptune as the Graph DB.
Given i have a node with a label name=ben, age=43, and gender='male'
My application finds the node by id:
{code:java}
g.V().has('34bb4352-996b-3415-479c-86215a0796ff').valueMap().toList().then((val)=> console.log(val));{code}
this outputs the following to the console:
[ Map \{ 'gender' => [ 'male' ], 'name' => [ 'ben' ], 'age' => [ 43 ] } ]
However, when sending this to the response of my express res.send(val) - produces [{}]
Similarly,
{code:java}
const map= await g.V().has('name','ben').valueMap().toList()
console.log( JSON.stringify(map))
{code}
results in the output of [{}]
Rather than a collection.
I am able to get an array of names if i populate a value within valueMap() But gremlin touts that i shoudl get the collection running this method.
This also occurs not just with valueMap but with elementMap.
The following example from the gremlin-javascript npm fails for me as it returns [{}] when serialized.
{code:java}
const findVertex = async (vertexId) =>
{ const vertex = await g.V(vertexId).elementMap().next(); return vertex.value; }
{code}
Please let me know what else i may be able to provide to understand how to help or overcome this issue.
was (Author: fezec):
Hello Stephen,
Thanks for the quick reply. I am using AWS Neptune as the Graph DB.
Given i have a node with a label name=ben, age=43, and gender='male'
My application finds the node by id:
g.V().has('34bb4352-996b-3415-479c-86215a0796ff').valueMap().toList().then((val)=> console.log(val));
this outputs the following to the console:
[ Map \{ 'gender' => [ 'male' ], 'name' => [ 'ben' ], 'age' => [ 43 ] } ]
However, when sending this to the response of my express res.send(val) - produces [{}]
Similarly,
const map= *await* g.V().has(*'name'*,*'ben'*).valueMap().toList()
console.log( JSON.stringify(map))
results in the output of [{}]
Rather than a collection.
I am able to get an array of names if i populate a value within valueMap() But gremlin touts that i shoudl get the collection running this method.
This also occurs not just with valueMap but with elementMap.
The following example from the gremlin-javascript npm fails for me as it returns [{}] when serialized.
const findVertex = async (vertexId) => { const vertex = await g.V(vertexId).elementMap().next(); return vertex.value; };
'
Please let me know what else i may be able to provide to understand how to help or overcome this issue.
> Gremlin JS Serializer always empty [{}] with valueMap(), entitypMap()
> ---------------------------------------------------------------------
>
> Key: TINKERPOP-2497
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2497
> Project: TinkerPop
> Issue Type: Bug
> Components: javascript
> Affects Versions: 3.4.9
> Reporter: Ben Smith
> Priority: Minor
>
> Sorry if I made this ticket incorrectly.
>
> I've installed gremlin as indicated.
> Running such a call as
> g.V(id).elementMap().toList(); fails to return from my client application
> output results is always [{}]
> same with return g.V(id).valueMap().toList();
> The above calls can output to the console correctly but not be serialized.
> Other toList calls work when the type is Vector. but seem to fail with Map.
> I am running Express, against Tinkertop 3.4.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)