Yes, you are right for database operations GlideRecord has been used. Also, as @hozawa mentioned it is necessary to use GlideRecord for update(). 

By looking at your script I don't see the need for GlideAggregate. As you don't have any condition that is checking for COUNT etc except in the logs you are printing the count. In your case, you can achieve the update using GlideRecord without GlideAggregate.   

Regards,
Muhammad