【发布时间】:2019-07-06 16:09:58
【问题描述】:
firestore .collectionGroup() 方法在云函数中与 firebase-admin sdk 一起使用时出错。是否可以对云功能中的 Firestore 进行集合组查询?
这是我尝试使用的 firestore 查询方法:https://googleapis.dev/nodejs/firestore/latest/Firestore.html#collectionGroup
但在firestore admin SDK中似乎不可用:https://firebase.google.com/docs/reference/admin/node/admin.firestore
admin.firestore().collectionGroup('photos').where('id', '==', photoId);
运行函数时出现此错误:
TypeError: admin.firestore(...).collectionGroup 不是函数
想知道我是否缺少某些东西,或者将来是否会添加这些东西。
【问题讨论】:
标签: node.js firebase google-cloud-firestore google-cloud-functions firebase-admin