我的Firestore规则中有一个函数,用于检查给定的文档是否存在:
function doesDocExists(docId) {
return exists(/databases/$(database)/documents/mycollection/$(docId))
}
在规则中,我写:
allow create: if ... && doesDocExists(docId);
问题是Firestore无法找到函数exists
:
但是如果我写allow create: if exists(...)
的话就可以了。