Summary
In Firestore Raw mode, the named database set on the Firebase resource is ignored — queries hit the "(default)" database instead (wrong data, missing-index errors point to default), even though GUI mode respects the configured named database.
AI Response
This is a known limitation: in Raw mode the Firebase client is initialized against "(default)" and does not pick up the database ID from the resource config, whereas GUI mode does. The workaround is to specify the target database explicitly in your raw-mode code via the firebase-admin SDK rather than relying on the resource setting — e.g. call getFirestore("your-database-name") (or pass the database name when obtaining the Firestore instance) so the client connects to the named database. Multiple community reports confirm this behavior and the SDK-based approach.
Sources
Firebase Raw mode gives PERMISSION_DENIED after switching from (default) to named database — GUI mode works fine
Corroborates the exact issue — several users confirm Raw mode initializes against "(default)" and ignores the resource's database ID, with staff suggesting you pass the desired database name when calling firestore via the firebase-admin SDK.
Support for Firestore multiple databases - connect to database besides default
Documents the underlying limitation and provides the concrete SDK syntax for targeting a non-default database, e.g. getFirestore("otherdb").
The Community Team is testing out a new automation. Let us know if it's helpful (or not) by leaving a
,
, or
. Or by marking this post as the "Solution"! Let us know if you have any feedback here. ![]()