Aggregate functions such as
max etc. are readily available in Datomic's Datalog implementation. They are written in the
:find clause in your query:
[:find (max ?date) :where ...]
An aggregate function collects values from multiple datoms and returns
(min n ?d)
(max n ?d)
(sample n ?e)etc. where
nis an integer specifying the size of the collection.
count the number of movies in the database
Find the birth date of the oldest person in the database.
Given a collection of actors and (the now familiar) ratings data. Find the average rating for each actor. The query should return the actor name and the