graph databases - How do I write a sub-query? -
I want to retrieve all the sentences and for every one I point it to the 'same' edges I want to count the number. / P>
How do I write this type of query in Gremlin?
Something like this might happen in SQL ....
SELECT *, (SELECT calculation (*) from tbl_like l WHERE l.id = b.id) Number of tbl_blah b
Example count in map ( m
) Use sideEffect
to insert
m = [:]; GVsideEffect {m [it] = It.inE.has ('label', 'like'). Count ()}
An option that leaves the corner with 0 likes:
m = [:]; GVEN ('like'). GroupCount (M) {it.inV.next ()}
Edit
Finally Smart Solution:
m = [:]; GV GroupCount (m) {it} {it.a.inE ('like'). The first closing of the count ()}
group code
determines the key to update and the second closure value for the key. When the second is off, it.a
thinks the current input value to groupCount
(one top here) and the previous value in it.b
The map for the input object is actually a document that has not been able to explain it, perhaps Tinker Pop can expand the exact use of one of the groupCount
closures.
Comments
Post a Comment