How to use the JS native array.contains in Firestore rules?
function isCool() {
return [
'xxx',
'yyy',
].contains(req.auth.uid)
}
The function above gives an error
You are looking for in
operator:
function isCool() {
return request.auth.uid in ['xxx', 'yyy'];
}
It returns true if the value is present in the given list/array.