I watched Firebase's official guide and the impression I got was request.resource.data points to the new data being written. However, when I'm testing in the emulator, request.resource.data exists no matter what I send, and always equals resource.data. I read the documentation and it's a little round about.
If these values should should be the same, how do I interpret this snippet from the guide
allow create: if
request.resource.data.score is number &&
request.resource.data.score >=1 &&
request.resource.data.score <=5 &&
This was said to prevent users from sending invalid 1-5 star ratings for a restaurant. However, per what I understand from the emulator, this validates the already existing data and not the incoming.
Link to moment in video: https://youtu.be/eW5MdE3ZcAw?t=628