@@ -155,7 +155,9 @@ export class DocumentReference<T = firestore.DocumentData>
155155 */
156156 get formattedName ( ) : string {
157157 const projectId = this . firestore . projectId ;
158- return this . _path . toQualifiedResourcePath ( projectId ) . formattedName ;
158+ const databaseId = this . firestore . databaseId ;
159+ return this . _path . toQualifiedResourcePath ( projectId , databaseId )
160+ . formattedName ;
159161 }
160162
161163 /**
@@ -2328,8 +2330,11 @@ export class Query<T = firestore.DocumentData> implements firestore.Query<T> {
23282330 transactionIdOrReadTime ?: Uint8Array | Timestamp
23292331 ) : api . IRunQueryRequest {
23302332 const projectId = this . firestore . projectId ;
2331- const parentPath =
2332- this . _queryOptions . parentPath . toQualifiedResourcePath ( projectId ) ;
2333+ const databaseId = this . firestore . databaseId ;
2334+ const parentPath = this . _queryOptions . parentPath . toQualifiedResourcePath (
2335+ projectId ,
2336+ databaseId
2337+ ) ;
23332338
23342339 const structuredQuery = this . toStructuredQuery ( ) ;
23352340
@@ -2387,8 +2392,11 @@ export class Query<T = firestore.DocumentData> implements firestore.Query<T> {
23872392 */
23882393 _toBundledQuery ( ) : protos . firestore . IBundledQuery {
23892394 const projectId = this . firestore . projectId ;
2390- const parentPath =
2391- this . _queryOptions . parentPath . toQualifiedResourcePath ( projectId ) ;
2395+ const databaseId = this . firestore . databaseId ;
2396+ const parentPath = this . _queryOptions . parentPath . toQualifiedResourcePath (
2397+ projectId ,
2398+ databaseId
2399+ ) ;
23922400 const structuredQuery = this . toStructuredQuery ( ) ;
23932401
23942402 const bundledQuery : protos . firestore . IBundledQuery = {
@@ -2858,7 +2866,8 @@ export class CollectionReference<T = firestore.DocumentData>
28582866 const tag = requestTag ( ) ;
28592867 return this . firestore . initializeIfNeeded ( tag ) . then ( ( ) => {
28602868 const parentPath = this . _queryOptions . parentPath . toQualifiedResourcePath (
2861- this . firestore . projectId
2869+ this . firestore . projectId ,
2870+ this . firestore . databaseId
28622871 ) ;
28632872
28642873 const request : api . IListDocumentsRequest = {
0 commit comments