Is it possible to check how many posts a user already have associated to them, and if that count exceeds a certain limit, then invalidate the request to create a new post?
I was thinking about having some basic settings at: /settings/limits/posts = 5.
And in the rules have something like:
".write": "root.child('settings/limits/posts').val() <= root.child('users/' + auth.id + 'posts').numChildren()"
That doesn't work, because numChildren isn't available. So how do you do such a check?
The only solution I've come up with, is to have a external server to do a count of a user's existing posts and only allow the server to write new posts.
Anybody else got any suggestions?