'Firebase Firestore rules resource.data not working

Can somebody please explain why this rule

match /invoices/{id} {
        allow read, update, delete: if request.auth.uid == resource.data.uid;
} 

giving me nothing, but when this:

match /invoices/{id} {
        allow read, update, delete: if request.auth.uid == 'gkaT45c7gYXCqQpw5al6Fbh9fgC3';
}

is working

enter image description here



Solution 1:[1]

solved the problem by changing the query and created an index relying on the new query variable

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Mario.G