Firestore rules path in production

Following the docs, I tried to debug the path

When I'm using the emulator locally, the path is like /databases/$(database)/documents/col1/doc1/col2/doc2/...

so this resource['__name__'][0] will be databases

and resource['__name__'][4] will be doc1

for example, this test function will return true:

function test() {
   return string(resource['__name__'][0]).matches('databases');

But, when I deploy the rules, the test function becomes false.

Is it because the path in production is different? If so, how can I see it? is there any example for a production path..

Read more here:

Content Attribution

This content was originally published by adotn at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: