为什么Firebase要求阅读访问以将一些内容写入集合中?

发布于 2025-02-08 20:57:09 字数 781 浏览 2 评论 0原文

为什么Firebase要求我阅读许可以便在集合中写东西?

这是我要做的事情:

            setDoc(doc(db, "UserOrders", {arguments[4] + 1}), {
                name: arguments[0],
                lastname: arguments[1],
                image: arguments[2],
                contact: arguments[3],
                orderNumber: arguments[4] + 1
            });

显然应该将一些信息写入集合中,并且它与读取属性无关,但是当我尝试执行此代码时,我会收到下一个错误。

这是我的射击规则:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow create, write: if true;
    }
  }
}

Why does the firebase asks me for reading permision in order to write something in a collection?

Here is what i am trying to do:

            setDoc(doc(db, "UserOrders", {arguments[4] + 1}), {
                name: arguments[0],
                lastname: arguments[1],
                image: arguments[2],
                contact: arguments[3],
                orderNumber: arguments[4] + 1
            });

Obviously it is supposed to write some information into a collection, and it has nothing to do with the read property, but when i attempt to execute this code i get the next error;

enter image description here

Here are my firebase rules:

rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow create, write: if true;
    }
  }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文