Close all todos older than a certain date

Hi. I have a number of old todos piling up which I want to mark as done. I can run a datomic search to find them. I also understand that there is a facility to batch process todos within a single block. However, as far as I know, there is no way to batch process todos identified via a query. Is there any way to do this? Thanks.