How to get average of a field within a document?

Hello All,

I am using algolia with a flutterflow application, I am collecting data from users and want to get an average result per user. I am collecting the data in a list within my users document.
Currently one user has 10 ratings, I want to find out the average of their rating.
Is there a way I can do this with the API? Or show it in the Algolia UI Demo?