[英]Getting undefined when using FieldValue or FirestoreAdminClient
as the title suggests I'm trying to use FieldValue and FirestoreAdminClient as follow:正如标题所示,我正在尝试使用 FieldValue 和 FirestoreAdminClient,如下所示:
const client = new admin.firestore.v1.FirestoreAdminClient();
And in another function of my server:在我的服务器的另一个 function 中:
await db.doc("stats/users").update({
total: admin.firestore.FieldValue.increment(1),
});
But when I run my function I get:但是当我运行我的 function 时,我得到:
TypeError: Cannot read properties of undefined (reading 'FirestoreAdminClient')
TypeError:无法读取未定义的属性(读取“FirestoreAdminClient”)
I don't know what's happening and why.我不知道发生了什么以及为什么。 If you have any suggestion please share it
如果您有任何建议,请分享
I don't know what was happening.我不知道发生了什么。 I uninstalled node completely and re-installed it and it works now.
我完全卸载了节点并重新安装它,它现在可以工作了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.