Код: Выделить всё
getDocs(query(collection(db, 'users'), where('shareWith', 'array-contains', email)))
.then(q => q.forEach(doc => console.log(doc.id, " => ", doc.data())))
;
< /code>
Почему это не работает со следующим правилом? < /p>
match /users/{userId}/{documents=**} {
allow read: if request.auth.token.email in get(/databases/$(database)/documents/users/$(userId)).data.shareWith;
allow read, write: if request.auth.uid == userId;
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... here-query
Мобильная версия