0

Ok, So i have done some googling and research for this use case and it's been hard to find an answer.

I have a firebase realtime db where i let users create records under their own user id. I want to create a rule that states if the user does not have a custom claim of "admin" they can create up to 5 records. if they have the admin privilage they create as many as they want.

is there a way to check number of children in a firebase realtime db rule?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
user2249567
  • 394
  • 4
  • 9
  • I'm not sure about rules, but you certainly could do that with cloud functions. Or on the client side, depending on your use case. – Thales Kenne Nov 07 '20 at 01:00
  • With security rules, It's not possible to check the number of children without also keeping track of the count yourself in another location. – Doug Stevenson Nov 07 '20 at 01:47

0 Answers0