I have got the following:
match /direct/{postId} {
allow read, write: if postId.includes(request.auth.uid);
}
However, I would like to only allow read, write if the document ID (postId) contains the string. .includes is not working for me in security rules.
Edit: it should match a substring instead of the entire document id
Edit2 https://imgur.com/hGTa9Iw collection called direct where each document ID is a string which contains 2 uids in it’s name.
Any help would be appreciated. Thanks.


request.auth.uidis exactly equal topostId, or just a substring? A substring match seems kind of strange here. - Doug Stevenson