You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Firebase云函数中将Firestore API从v1升级到v2

Cloud Functions v2升级后Firestore API升级疑问

我已查阅了Cloud Functions升级至v2版本的文档,但未找到关于在云函数内升级Firestore API的相关说明。

当前代码示例:

import { onCall } from 'firebase-functions/v2/https'; // 新版v2 - 正常可用
import { firestore, initializeApp } from 'firebase-admin'; // 旧版 - 需要升级
  • 技术栈:Node.js 18 云函数
  • 依赖版本:firebase-admin: ^11.8.0,firebase-functions: ^4.3.1

内容的提问来源于stack exchange,提问作者Chen Peleg

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 10:12:41