values are not populated in table

7 views
Skip to first unread message

Nikhanj

unread,
Jul 20, 2012, 1:38:27 AM7/20/12
to ne...@googlegroups.com
Hi,
   I have list of node ids like-> list1=[v[11],v[12],v[13]]
   I want to iterate this list and store each node's id and also type prop of node's out node,in a new table every time on iterating the list..
   I tried the below script

   t=new Table();
   i=-1;
   while(++i<list1.count()) list1[i].as('ID').out.Type.as('TYPE').table(t);

but table is empty. When i perform the same for individual item in the list, table values are populated. I guess values are not getting appended in table on iterating the list.

I want node id and type prop to be stored. 
I can perform the below,
                                       i=-1;
                                       newlist=[]
                                       while(++i<list1.count()) list1[i].out.Type.aggregate(newlist)

  but if i do this only Type value will be stored .Rather i want node id and also type value.

I expect an output like this 
--------------------------------
NodeId:11,Type:type1
NodeId:12,Type:type2 
NodeId:13,Type:type3

How to achieve this ?????

Peter Neubauer

unread,
Jul 20, 2012, 10:38:46 AM7/20/12
to ne...@googlegroups.com
Hi Nikhanj,
this might be the same issue as before: http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html#rest-api-send-a-gremlin-script---json-encoded-with-table-results gives you an example, don't forget the .iterate() (I inserted a TIP at the beginning of the chapter on http://docs.neo4j.org/chunked/snapshot/gremlin-plugin.html now :)

/peter


--

Cheers,

/peter neubauer

G:  neubauer.peter
S:  peter.neubauer
P:  +46 704 106975
L:   http://www.linkedin.com/in/neubauer
T:   @peterneubauer

Wanna learn something new? Come to @graphconnect.
Reply all
Reply to author
Forward
0 new messages