假设我有一个数据库:
emails
- [email protected]: userID1
- [email protected]: userID2
- [email protected]: userID3
如何创建用户可以搜索以查看电子邮件地址是否存在并随后获取用户 ID,但无法查看整个列表的 Firebase 规则?
例如
/path emails {
read() { true }, // But will let user view all emails signed up
write() { writeIfNotExists() }
}
用户无法搜索不允许他们阅读的数据。用户可以读取数据,在这种情况下他们可以搜索和检索数据,或者他们无法读取数据,在这种情况下既不能检索也不能搜索数据。
如果您想实现这样的用例,最好的办法是在 Cloud Functions for Firebase 中实现一个搜索 API 作为HTTP 端点。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句