[
https://issues.apache.org/jira/browse/TINKERPOP-2450?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Stephen Mallette closed TINKERPOP-2450.
---------------------------------------
Resolution: Not A Bug
Gremlin Server returns a "reference" for graph elements like vertices and
edges, thus no properties are attached, only the {{id}} and {{label}}. The
preferred method for getting results from Gremlin is to transform vertex/edge
data to common structures like {{List}}/{{Map}} and restrict those results to
just the data you need (typically using steps like {{valueMap()}},
{{elementMap()}}, {{project()}}, etc. The notion of references is documented in
a number of places, so perhaps you just missed it.
This history/reasoning/etc for this design choice can be found in the link I
provided in reply to your post on the dev list about a "javascript TinkerGraph"
- I'll reference it again here for convenience:
https://lists.apache.org/thread.html/e959e85d4f8b3d46d281f2742a6e574c7d27c54bfc52f802f7c04af3%40%3Cdev.tinkerpop.apache.org%3E
> Get Correct Result when working with gremlin-server and javascript
> ------------------------------------------------------------------
>
> Key: TINKERPOP-2450
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2450
> Project: TinkerPop
> Issue Type: Bug
> Components: server
> Reporter: Serg Salo
> Priority: Major
>
> I have installed gremlin-server docker image. I am able to connect to it from
> javascript client and execute addV and V to list the nodes.
> I am not sure what is going on, but
> const list = await g.V().valueMap().toList();
> console.log(list);
> console.log(JSON.stringify(list));
> produces:
> [ Vertex \{ id: 0, label: 'person', properties: undefined } ]
> [\{"id":0,"label":"person"}]
> Now, let's use valueMap:
> const list = await g.V().valueMap().toList();
> console.log(list);
> console.log(JSON.stringify(list));
>
> produces:
>
> [ Map \{ 'name' => [ 'foo' ] } ]
> [{}]
>
> So, is serialization an issue? or do I need to configure server properly?
> or...
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)