Firestore规则-位于另一个函数中时找不到“存在”函数

时间:2019-03-19 15:29:35

标签: firebase google-cloud-firestore firebase-security-rules

我的Firestore规则中有一个函数,用于检查给定的文档是否存在:

function doesDocExists(docId) {
  return exists(/databases/$(database)/documents/mycollection/$(docId))
}

在规则中,我写:

allow create: if ... && doesDocExists(docId);

问题是Firestore无法找到函数exists

enter image description here

enter image description here

但是如果我写allow create: if exists(...)的话就可以了。

0 个答案:

没有答案