Question regarding firebase rules | Sololearn: Learn to code for FREE!


Question regarding firebase rules

I had a firebase code in sololearn which votes for some things (for examples programming languages). But I had to make it private because some users manually write the program and submit results with spamming and bad words. Therefore I tried to solve that problem using configuring the firebase rules. Most of the rules are working but I want to know if the value submitted is an array. For example reference.update(["java","c"]) //valid reference.update(true) //invalid Many examples in google are not working

2/16/2019 10:26:05 AM


11 Answers

New Answer


Seniru Pasan Look here regarding saving arrays Now, are you trying to determine using the rules if the value is an array? if so, maybe this will help


Yeah, I was looking at the same post as Burey 😅 Here an implementation:


Seniru Pasan So what is your intention? It might help if you share the code


Burey Coder Martin Madhav can u help?


Martin I have tried newData.child(0).exists() before. But it won't work as intended


Code is here I have to turn on the computer to get the rules.


Coder i want to check the updated value is an array using firebase rules. More info in top.


Coder lol it was in that blog post


Sonic then most of the users will be blocked 😆. The best thing is to configure rules. So no extra work for mods . And also there is no way of finding the username of a user in my app