-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose databaseId and projectId on Firestore class #1936
Comments
@tom-andersen with Multi-DB support, I think this is essential to effectively work with it. I checked the other SDKs (Android, iOS) that allow to retrieve the settings again (which the NodeJS SDK does not), so it could be an option to do: reference.firestore.settings.databaseId
reference.firestore.settings.projectId There would be naming conflict though between the /cc @wu-hui |
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/nodejs-firestore/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #1936
Given the introducing of multiple databases it becomes more and more often that you want to know from where a Reference or snapshot was created for.
Right now there is no way to go from a
DocumentReference
or aDocumentSnapshot
to the database or the project.It should simply be possible to do the following:
Those getters already exist but they are marked a private/internal making accessing them in Typescript unavailable.
Right now you need to do some fishy stuff accessing internal variables, silencing Typescript errors (using
as any
) or other unofficial, undocumented things.Given those things are not officially supported and APIs may change without proper breaking changes this makes depending on those workarounds, not a solution.
The text was updated successfully, but these errors were encountered: