4

I am trying to get the count of all vertices with a particular label and all its children in one query like so:

g.V().hasLabel('folder').has('folder_name', 'root').as_('a', 'b').select('a', 'b').by(__.count()).by(__.in_('items_belongs_to_folder').count()).toList()

This should ideally return [{a: 200, b: 400}], but I am instead getting a list like so:

[{a: 1, b: 0},{a: 1, b: 0},{a: 1, b: 0},{a: 1, b: 0},{a: 1, b: 0},{a: 1, b: 0},{a: 1, b: 0},....{a: 1, b: 0}]

How exactly can I achieve the desired result?

gremlinpython: 3.4.4 (latest)

Python 3.7

graph database: AWS Neptune

4

1 に答える 1