firebase-js-sdk
firebase-js-sdk copied to clipboard
getFirestore jsDoc databaseId parameter confusing
Operating System
irrelevant
Browser Version
irrelevant
Firebase SDK Version
10.8.0
Firebase SDK Product:
Firestore
Describe your project's tooling
Simple React SPA + Typescript
Describe the problem
The jsDoc documentation of the getFirestore
method is confusing. When connecting to a named ( non "default") firestore, there is a second parameter for the getFirestore method
. The jsDoc states that:
* @param databaseId - The name of the database.
Firestore databeses have IDs and names also, so this terminology is not clear.
Location: https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/api/database.ts#L233
Also the official docs are also could be clearer of what is the database id, and how to obtain it: https://firebase.google.com/docs/firestore/manage-databases?hl=en&authuser=0#access_a_named_database_with_a_client_library
Steps and code to reproduce issue
As stated above the location of this jsDoc is here: https://github.com/firebase/firebase-js-sdk/blob/master/packages/firestore/src/api/database.ts#L233