Aggregation queries involving array indices

Firstly, great work on creating and maintaining DGraph.

I’d like to perform a custom aggregation query which takes into account the relative position of the values (in a sorted array). Essentially, I want to weight the values by the inverse square of their position in the array.

I have read quite a bit of the DGraph query documentation, but am struggling to work out if the above is possible with the current query interface. I wondered whether it would require some kind of custom aggregation function other than those currently available (eg. min/max/sum). If a custom aggregation function is necessary, is there some way to script such a function and register it with DGraph?

Any help/advice would be appreciated. Thanks!

For now we have only Custom Tokenizers - The only way to add a new feature is by PR.

Are you talking about List Type? https://docs.dgraph.io/query-language/#list-type

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.