firebase / firebase/firebase-js-sdk

getFirestore jsDoc databaseId parameter confusing

Open
#8,018 0 comments 0 reactions 1 assignee Claimed by @wu-hui View on GitHub
api: firestore needs-attention question
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.