Firebase AfterSave功能就像Parse.com一样 [英] Firebase AfterSave function like Parse.com

查看:164
本文介绍了Firebase AfterSave功能就像Parse.com一样的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我使用Parse.com的AfterSave云代码功能来保存与特定位置有关的最新帖子的列表。这样做的原因是获得最近的职位,而不必搜索和订购所有地点的职位的整个列表。



这很好地在解析AfterSave因为我不必担心客户执行这个命令,所以在云中运行是有意义的。现在解析正在关闭,我决定迁移到Firebase。在Firebase中是否有一个平等的功能,或者我的客户需要维护最近发布的帖子?

谢谢

原问题重新解析获取每场最新的记录在Parse.com JS查询

解决方案

目前无法在Firebase的服务器上运行您的代码。所以,你将不得不想出一个不太直接的云代码映射到一个新的解决方案。在每个客户端上运行功能是一种选择,在廉价的机器人/服务器上运行它是另一个选项。



我会在这里找到几个问题覆盖之前,并在这里链接:



要记住的一点是,像这样运行服务器并不是你马上想到的编写服务器的类型。其中大部分行为更像是一个机器人,与您的客户端代码一样,与Firebase进行交互。在这种情况下唯一的区别就是它在你控制的环境上运行,所以它可以用提升的凭证运行。


So I was using Parse.com AfterSave cloud code function to keep a list of the most recent Posts relating to a specific location. The reason for this is to get the most recent post for a location without having to search and order the entire list of posts for all locations.

This was nicely done in Parse AfterSave because I didnt have to worry about clients exectuing this command, it made sense for it to run in the cloud. Now that parse is shutting down, I've decided to migrate over to Firebase. Is there an equivilant functionality in Firebase or will my clients need to be maintaining the list of most recent posts?

Thanks

Original question re Parse Get latest record per field in Parse.com JS query

解决方案

There is currently no way to run your code on Firebase's servers. So you will have to come up with a less-direct mapping of Cloud Code to a new solution. Running the functionality on each client is one option, running it on a cheap "bot"/server is another one.

I'll find a few questions where this has been covered before and link them here:

One thing to keep in mind is that running a server like this is not the type of "writing a server" that you're immediately thinking of. Most of these act more like a "bot" that interacts with Firebase in the same way as your client-side code does. The only difference in that case is that it runs on an environment you control, so that it can run with elevated credentials.

这篇关于Firebase AfterSave功能就像Parse.com一样的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆