Firebase Firestore rules path in production

Viewed 133

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 (locally, using the emulator):

function test() {
   return string(resource['__name__'][4]).matches('doc1');
}

Or:

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..

0 Answers
Related