A user needs to be able to add their uid to an array called 'users', within a document. They should only be able to add/remove their uid, and nothing else.
I need to write a security rule to allow for this, but can't figure out how to do array comparison in the security rules.
It needs to be something like this:
allow update: if request.resource.data.users == [...resource.data.users, request.auth.uid]
This is the query:
.update({
users: firebase.firestore.FieldValue.arrayUnion(params.uid),
})
Is this possible?