tha*_*ffe 6 firebase google-cloud-firestore
我试图在 firestore 规则中使用路径的大小,但无法让任何东西起作用,并且在 firestore 文档中找不到有关如何执行此操作的任何参考。
我想使用最后一个集合名称作为规则中的参数,所以尝试了以下方法:
match test/{document=**}
allow read, write: if document[document.size() - 2] == 'subpath';
Run Code Online (Sandbox Code Playgroud)
但 .size() 似乎不起作用,.length 也不起作用
您可以在这里学习规则
// Allow reads of documents that begin with 'abcdef'
match /{document} {
allow read: if document[0:6] == 'abcdef';
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
571 次 |
| 最近记录: |