I am using Java with TinkerPop v. 3.5.1 with Neptune DB
I am trying to use either .path().by("fieldName").by("otherFieldName") but I am only getting the value from the last .by("otherFieldName") returned, when I want the values from both .by().
Here is a sample graph (generated in gremlify):
g.addV('Student').as('1').
property(single, 'name', 'Peter').
property(single, 'age', 22).addV('School').
as('2').
property(single, 'name', 'Jefferson').
property(single, 'address', '1234 Jefferson St.').
addV('Administration').as('3').
property(single, 'status', 'AFW').
property(single, 'level', '4.2A').
addV('Class').as('4').
property(single, 'name', 'Math').
property(single, 'level', 2).addV('ClassReq').
as('5').
property(single, 'name', 'Math').
property(single, 'level', 1).addV('Student').
as('6').
property(single, 'name', 'Sam').
property(single, 'age', 24).addV('Class').
as('7').
property(single, 'name', 'English').
property(single, 'level', 2).addE('attends').
from('1').to('2').addE('administers').
from('3').to('2').addE('isReqsFor').from('5').
to('4').addE('offers').from('2').to('4').
addE('attends').from('6').to('2').
addE('offers').from('2').to('7')
When I use:
g.V().has("name", "Jefferson").out("offers").aggregate("x").by("level").by("name").cap("x")
I only get the "name" fields returned:
[
[
"English",
1,
"Math",
1
]
]
Also, what are the 1 fields in the returned value? There is no "level" field in the start node (School). The "level" values should both be 2 if it was from the Class node.
Is there some way to return the values for multiple fields in the vertex?