Byron Bailey created TINKERPOP-2228:
---------------------------------------
Summary: by(valueMap(true)) drops all properties during query
Key: TINKERPOP-2228
URL: https://issues.apache.org/jira/browse/TINKERPOP-2228
Project: TinkerPop
Issue Type: Bug
Components: javascript
Affects Versions: 3.4.1
Environment: MacOS Mojave 10.14.4
Reporter: Byron Bailey
When using the by(valueMap(true)) step when using the gremlin javascript
plugin, a result set is returned but the properties are all missing. The same
query works from the console. Additionally, the same query without
by(valueMap(true)) returns a valid result set.
Below is the sample code with the output, along with the same query against the
same graph using the console. The test case is a simple server architecture
with a "host" node having three edges connecting it to 2 "vm" nodes and a
chassis node. I have also tried the identical query using client.submit() and
receive failed results.
{{const g = traversal().withRemote(new
DriverRemoteConnection('ws://localhost:8182/gremlin'));}}{{}}
const __ = gremlin.process.statics;
function getNeighbors(label, uuid){
console.log("> getNeighbors "+label+"["+uuid+"]"); return g.V()
.has(label,"uuid",uuid)
.bothE()
.otherV()
.path()
.by(__.valueMap(true))
.toList()
}
{{getNeighbors("host", "host1")}}
{{.then(results => {}}{{ }}
{{ console.log("Sending results..."+JSON.stringify(results));}}{{ }}
{{});}}
OUTPUT:
> getNeighbors host[host1]
Sending
results...[\{"labels":[[],[],[]],"objects":[{},{},{}]},\{"labels":[[],[],[]],"objects":[{},{},{}]},\{"labels":[[],[],[]],"objects":[{},{},{}]}]
Same query from console:
gremlin>
g.V().has("host","uuid","host1").bothE().otherV().path().by(valueMap(true)).toList()
==>path[\{id=1, label=host, model=[D-host], manufacturer=[Dell], name=[host1],
uuid=[host1]}, \{id=0, label=MOUNTED_IN,
uuid=6ca30477-80e2-4df6-9e00-10adddc0c04f, name=host1 to chassis1, slots=1},
\{id=0, label=chassis, model=[D-chassis], manufacturer=[Dell], name=[chassis1],
uuid=[chassis1]}]
==>path[\{id=1, label=host, model=[D-host], manufacturer=[Dell], name=[host1],
uuid=[host1]}, \{id=20, label=MOUNTED_IN,
uuid=ea0b7e49-9738-4624-86e7-ba57de873120, name=vm1 to host1}, \{id=22,
label=vm, name=[vm1], uuid=[vm1]}]
==>path[\{id=1, label=host, model=[D-host], manufacturer=[Dell], name=[host1],
uuid=[host1]}, \{id=16, label=MOUNTED_IN,
uuid=966ad71a-ad09-4877-93b2-14779edf3ba9, name=vm2 to host1}, \{id=21,
label=vm, name=[vm2], uuid=[vm2]}]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)