How can I calculate the average RATE per YEAR for each TYPE in MongoDB based on this data structure?
"SHOP": [ { "_id": str,