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)",},
".validate": "data.val() == newData.val() || (newData.isNumber() && ((data.val() == null && newData.val() == 1) || newData.val() === data.val() + 1))"