Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda