According to the Firestore security rules docs, using the affectedKeys() MapDiff function will return a rules.Set().
function getName() {
return ({"alice":"owner", "john":"writer"}).diff({"john":"writer"}).affectedKeys();
}
In the example above, ["alice"] would be returned from the function, but as a Set type, not a List type.
I am in need of casting the returned value as a String ("alice") rather than a Set, but so far am unable to find a way to do that. Is it possible to achieve this?
There would be, if you could convert a Set to a List. But without that conversion, it's not possible. I suggest filing a feature request with Firebase support.
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