In this output only “primary_ids” are stored
what to do if we want to store there attributes too ?
i know results output contains the attributes too
but ForEach loop wont work on the results
ForEach loop works on @@pps. that’s why we want the attributes inside @@pps
What is your reason for wanting to use a FOREACH?
Are you sure that you can’t use an SELECT statement to iterate on our vertex set?
If you need/want to store a set of vertices with a small number of their attributes, you can define a TUPLE, such as TYPEDEF TYPE <id STRING, attr1 INT, attr2 STRING, attr3 FLOAT> vertexStruct;
Simple example of a query (degree centrality graph algorithm) that uses a user defined tuple: