Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
i want my firebase realtime database to ONLY accept new data that is +1 more than current data. current code not working as expected

for security I want this points data to ONLY be able to increase by 1. no more.

technically I want the points to save if the data is as follows: points = 1 on app and in database ACCEPT DATA. or. points = 2 on app and 1 in database ACCEPT AND UPDATE. anything else , NO.

I don't want somebody to change my app scripts and say: "hey , lets make it give me 1000 points instead of 1.

This is the Rules I am using that isn't giving me the result I want:

    "points": {
      // asserts points is a number and is correctly increased by 1
      ".validate": "newData.isNumber() && ((data.val() == null && newData.val() == 1) || 
                    data.val() == data.val() || newData.val() === data.val() + 1 && 
                    newData.val() > data.val() && newData.val() < data.val() +2)",},
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

".validate": "data.val() == newData.val() || (newData.isNumber() && ((data.val() == null && newData.val() == 1) || newData.val() === data.val() + 1))"
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!