Well, the context is - I know UID of the node, how can I get the size of the k-hop neighborhood (the amount of nodes connected to the provided one directly, or through other nodes, up to the k-th depth). For example here, the size of the neighborhood of this node is 13:
A sample also would be good. If I don’t know what its structure is like, I can’t explore the possibilities. Also, Recurse is a very different query from others, some things may not work well depending on the structure.
In recursive query is mandatory to insert the predicates you need. Cuz it can traverse a lot of type of nodes. And the purpose of the recurse is for recursing in a determined set of predicates/edges. Otherwise you should just use expand_All.
e.g:
This way you will expand all recursively predicates to as many levels as you need. However, there is no “count(_all_)”.
PS. I believe hardcoding is important as it makes the responses predictable (Including the position of keys and values in the answer). I would never recommend using expand_all in a production application. Only if you know what you doing, if you have total control of your DB, Schema, Dataset and you’re okay with it.