1

In my app, each user has a document in the users collection of my database. Under each user's document, there is a subcollection for that user's uploaded foods. By default, I want to limit it so that the user cannot add more than 25 foods to their personal subcollection. Is there a way to check via Security Rules if the collection size is <= 25?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
DangItsPang
  • 29
  • 1
  • 2

1 Answers1

0

It's not possible in security rules.

If you want a document count, you will have to manage one of your own in a single document. Then you could write rules to check against the count that you manage in that document.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441