Tha*_*hật 5 node.js firebase google-cloud-firestore
我在遵循此处使用 count() 聚合的示例时遇到错误
我的代码是:
const collectionRef = db.collection('cities');
const snapshot = await collectionRef.count().get();
const amount = snapshot.data().count;
res.json({ amount });
Run Code Online (Sandbox Code Playgroud)
错误说:
函数:类型错误:collectionRef.count不是函数
有人可以帮忙吗?
该count()查询已添加到firebase-admin@11.2.0. 如果您使用的是旧版本,请尝试更新到最新版本。
npm i firebase-admin@latest
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
965 次 |
| 最近记录: |