I'm trying to prevent duplicate entries using Google Firestore rules, however it's not working. The rule I'm trying is:
service cloud.firestore {
// Prevent duplicate messages
match /databases/{database}/documents {
match /messages/{message} {
allow read;
allow write: if request.resource.data.m != resource.data.m;
}
}
}
From what I read, this should work.
What am I doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…