Open Side Menu Go to the Top
Register
Managing the size of a firebase noSQL DB Managing the size of a firebase noSQL DB

10-06-2016 , 01:22 PM
I have a firebase database that is a collection of shared user posts. Each post can be liked by the users. These posts are delivered to the client sorted either by most recent or by top liked posts.

Once the lists of posts get beyond say 1000 in either category they cease to be useful and I would like them to be deleted. I need this to be done on a regular basis, but I cannot figure out how to automate this. So I need to delete a post if it either not in the top 1000 of most recent or top 1000 liked posts. There doesn't seem to be a way within the firebase system.

Do I write a server script and attach a cron job to it? If so, what would be the best way to get the posts that need to be deleted? Then to I go and delete each one, one by one?

any thoughts would be appreciated. Thanks.
Managing the size of a firebase noSQL DB Quote

      
m