且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Firebase:是否可以设置服务器端的定时删除?

更新时间:2023-11-27 22:05:10

它集成了自动化。它是实时存储,检索和提供跨设备JSON数据的快捷方式。一个想法是:1.获取用户登录的时间2.比较日期3.向Firebase发送所需的操作。最后,您可以创建一个服务器端或节点代码段,定期联系您的Firebase数据库并执行此类任务。




I'm developing a chat application based on Firebase. I would like to delete automatically every message after 24 hours. Is it possible to do it with Firebase? If yes, how?

Thanks in advance

I don't think Firebase purpose it to integrate automatition. It serves as a fast way to store, retrieve and serve JSON data across devices in real time. An idea would be to: 1. get the time the user signed in 2. compare dates 3. send a desired operation to Firebase.

Eventually you can create a server-side or Node snippet that would periodically contact your Firebase database and perform such tasks.