0

Is it possible to create a firebase rule that allow to create documents in a collection if the number of documents in that collection hasn't reached a max ?

Something like this : doc:

/databases/{database}/documents/activities/activity :
{
    "max_users": 10
}

rules:

match /databases/{database}/documents/activities/activity/participants/{userUid} {
    allow create if [doc_count] < [max_users];
}
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807

0 Answers0