a) Add code to:
Read all firebase records in the path.
Display the records on the screen.
Run the program
read all records in a path - part 1
read all records in a path - part 2
a) Add code to:
Pass the read record & read all functions the name of the function to process the data.
Modify the read record & read all functions to call a function to process the data.
Define your process data functions.
Run the program
Watch the videos and use the rules playground to try out various rules
rules - part 2
rules - part 3; role base authorisation
validation
"first_name": {".validate": "newData.isString()"}
"first_name": {
".validate": "newData.isString() &&
newData.val().length < 100"
}
"age": {".validate":
"newData.isNumber() && newData.val() >= 18 && newData.val() <= 65"
}
"angle": {".validate": "newData.isNumber() &&
(newData.val() == 0 ||
newData.val() == 90 ||
newData.val() == 180 ||
newData.val() == 270)"
}
first_name must be a string
first_name must be a string and its length must not exceed 100 characters
age must be a number between 18 and 65
angle must be a number and can only be one of the values specified (0,90,180 or 270).
To remove the readon or listener use the .off command:
database.ref(_path + '/' + _key).off();
NOTE: you can also label your readon/listener and then use that to remove the readon/listener:
?????.off();