定期将 Json 数据保存在我的 Firebase 数据库中
Regularly save Json data in my Firebase database
我没有在网上找到 Google 文档如何自动检索 Json 数据并将其保存在 Firebase 数据库中。
我的目标: 每小时调用一个外部 JSON 并将数据保存在我的 Firebase 实时数据库中。
可能吗?
非常感谢您的帮助。
您可以使用 Cloud Functions 执行此操作,这些功能是 运行 在 Google 的服务器上的代码片段。您可以 run such functions on a schedule,例如 link 中的示例:
exports.scheduledFunction = functions.pubsub.schedule('every 5 minutes').onRun((context) => {
console.log('This will be run every 5 minutes!');
return null;
});
在该函数中,您可以 运行 任何您想要的进程。
Cloud Functions for Firebase 仅限于 运行ning Node.js 代码,但还有其他解决方案(例如 Google Cloud Run)可以 运行 更多语言。
我没有在网上找到 Google 文档如何自动检索 Json 数据并将其保存在 Firebase 数据库中。
我的目标: 每小时调用一个外部 JSON 并将数据保存在我的 Firebase 实时数据库中。
可能吗?
非常感谢您的帮助。
您可以使用 Cloud Functions 执行此操作,这些功能是 运行 在 Google 的服务器上的代码片段。您可以 run such functions on a schedule,例如 link 中的示例:
exports.scheduledFunction = functions.pubsub.schedule('every 5 minutes').onRun((context) => {
console.log('This will be run every 5 minutes!');
return null;
});
在该函数中,您可以 运行 任何您想要的进程。
Cloud Functions for Firebase 仅限于 运行ning Node.js 代码,但还有其他解决方案(例如 Google Cloud Run)可以 运行 更多语言。