So in my database schema I have something like this
/collections/users/userId1 {
...,
id,
relatedContracts: [id1, id2, id3]
}
/collections/contracts/contractId {
...,
id,
}
In my firebase security rules I have this
match /contracts/{contract} {
function isOwnContract() {
return request.auth.id == resource.data.creatorId || request.auth.id == recipientId
}
allow read, write: if isOwnContract()
}
Now I am very confused on how to filter on the client to get only my related contracts. If the introduction of the security rules I can no longer do my filtering on the client.
I know this exists
firestore.collection(CONTRACTS).where(id, "==", contractId)
But how do I do this filtering based on multiple ids
You currently can't fetch multiple ids per query on the client, so your choices are to either:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With