How can I change the query g.V().has('uid','234244').as('a').bothE().label().as('b').groupCount().by(select('a','b'))

21 views
Skip to first unread message

אלה וייס

unread,
May 1, 2016, 3:57:31 AM5/1/16
to Gremlin-users
The following query 

g.V().has('uid','234244').as('a').bothE().label().as('b').groupCount().by(select('a','b'))

results with :

==> [[a:v[343433],b:Friend]:1 , [ [a:v[343433] ,b:like]:1 ]

I would like it to be :

 [{a:v[343433],[{b:Friend:1},{b:like:1

אלה וייס

unread,
May 1, 2016, 4:30:19 AM5/1/16
to Gremlin-users
I solved it by adding .next() in the end of the query

בתאריך יום ראשון, 1 במאי 2016 בשעה 10:57:31 UTC+3, מאת אלה וייס:

Daniel Kuppitz

unread,
May 1, 2016, 9:46:00 AM5/1/16
to gremli...@googlegroups.com
.next() doesn't change anything. The result you're looking for would be produced by this query:

g.V().has("uid","234244").as("a","b").select("a","b").by().by(bothE().groupCount().by(label))

Or this (in TP 3.2+):

g.V().has("uid","234244").project("a","b").by().by(bothE().groupCount().by(label))

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/4fb91c85-6561-4f0d-a799-69f528724eb4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

אלה וייס

unread,
May 2, 2016, 1:47:14 AM5/2/16
to Gremlin-users
thanks !!!


בתאריך יום ראשון, 1 במאי 2016 בשעה 10:57:31 UTC+3, מאת אלה וייס:
The following query 
Reply all
Reply to author
Forward
0 new messages