Keeping Firebase Realtime Database clean

Hello thunkers !
Heres my today`s issue (ill simplify to basics): My app allows users to create some datas on Firebase.
In my example, “FISHING TEST 2021” is created by a user. And this kind of datas will be created by any user that want to define his own contest.
My thought is to delete some of these contests after a while (lets say that i want to delete a contest 3 months after creation, because will become old and unnecesary datas will fill the server. (dont want to fill up the firebase with old datas not needed anymore).
My solution is to add a field on a new created data that keeps time of creation, then when any user login it checks the entire list and delete all old data (checking list is made anyway for other purposes).
And now my question: maybe theres a more efficient solution, maybe some Realtime database rules that will do this automatically or something like that ?
Thank you.