Complete the code to allow read access only if the user is authenticated.
allow read: if request.auth [1] null;
The rule request.auth != null checks if the user is signed in.
Complete the code to allow write access only if the user's ID matches the document ID.
allow write: if request.auth.uid [1] resource.id;
The rule request.auth.uid == resource.id ensures users can only write their own data.
Fix the error in the rule to allow writes only if the new data has a 'score' field that is a number.
allow write: if request.resource.data.score [1] int;
The is operator checks the data type of a field in Firebase rules.
Fill both blanks to allow writes only if the new data has a 'name' field that is a string and is not empty.
allow write: if request.resource.data.name [1] string && request.resource.data.name.[2] > 0;
The is operator checks the type, and size gets the string length to ensure it's not empty.
Fill all three blanks to allow writes only if the user is authenticated, the 'age' field is a number, and the age is at least 18.
allow write: if request.auth [1] null && request.resource.data.age [2] int && request.resource.data.age [3] 18;
This rule checks that the user is signed in, the age is a number, and the age is 18 or older.