简体   繁体   English

使用 FieldValue 或 FirestoreAdminClient 时未定义

[英]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.

相关问题 使用条带结帐时出现未定义的错误和 url - Getting undefined for error and url when using stripe checkout 谷歌云功能 Firebase 使用 NodeJS 更新 FieldValue.increment(1) - TypeError: FieldValue.increment is not a function - Google cloud functions Firebase Update FieldValue.increment(1) using NodeJS - TypeError: FieldValue.increment is not a function Firestore中的Cloud Functions FieldValue增量TypeError - Cloud Functions FieldValue increment TypeError in Firestore firebase.firestore.FieldValue.arrayUnion 不是 function - firebase.firestore.FieldValue.arrayUnion is not a function FieldValue.increment 不起作用但添加“操作数” - FieldValue.increment does not work but adds "operand" 为什么我从 localStorage 中得到未定义? - Why I am getting undefined from the localStorage? 使用 busboy 将图像上传到 firebase 时遇到问题:输入 busboy.on() 时我的变量未定义 - Having trouble uploading a image to firebase using busboy: my variable gets undefined when entering a busboy.on() Swift:如何在 document().setData() Firestore 数据库中使用 FieldValue.serverTimestamp()? - Swift: How to use FieldValue.serverTimestamp() in document().setData() Firestore database? Firestore 规则 - 更新具有 FieldValue.delete() 的文档 - Firestore Rules - Update document that has FieldValue.delete() 当我向我显示此错误“无法读取未定义的属性(读取'_internalPath')”时,我尝试使用nodejs和firestore中的过滤器获取数据 - I tried to get data using filter in nodejs and firestore when show me this error "Cannot read properties of undefined (reading '_internalPath')"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM