1 2 3 4 5 6 7
FROM e IN events GROUP BY e.data.department PROJECT INTO { department: UNIQUE(e.data.department), cost: AVG(e.data.salary) }