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
Port FirebaseDataConverter interface #856
Comments
@jeantil Thanks for filing this report. I understand your frustration - we try to align these APIs as best as we can, but under the hood the SDKs are very different. The Web API is much richer in some aspects (since the SDK supports persistence and local edits), while in other aspects the Server API supports more functionality (e.g. Regarding some of the specifics you mentioned:
|
Thank you very much for our answer and your understanding. I'm glad to know there is work in progress on implementing
And that's perfectly fine and acceptable
That's fine, I'm a fairly recent user of firebase and I don't expect much. I know I would much prefer that if trying toserialize a date object simply failed or produced a nonsensical result in the store. Then I would know immediately that I have to convert before storing and upon reading values from the store. Thanks again. |
Is your feature request related to a problem? Please describe.
I recently started storing documents which have fields of type Date using the admin sdk (since I run server side). I was unpleasantly surprised to find that reading the documents back would return these fields as a firebase Timestamp but I can understand why it works that way.
Searching for a way to convert these back to more standard types in a generic way, I found documentation on
FirebaseDataConverter
which is applicable toDocumentReference#withConverter
and then wasted a couple hours trying to understand why I couldn't find this method in my code and upgrading various firebase dependencies in the hope of getting the version with the method only to finally understand that the server side implementation didn't have that.Describe the solution you'd like
I would thus like for the
#withConverter
method and the correspondingFirestoreDataConverter
api to be implemented in the admin/server side SDK.Additional context
I find it really confusing that the APIs on the admin and client implementations use exactly the same names but with slightly different apis. Google search results rarely if ever provide enough context to know which implementation the code sample is applicable to, same on stackoverflow.
Having firebase testing actually pull in the client sdk and not having a server side testing lib further increased my confusion by installing both dependencies in node_modules.
Since both codebase describe the same thing, I would like for both apis to be the same with a single documentation. Where some operations are specific to cient or server, they can be tagged as such in the documentation (ideally explaining why they only make sense on one or the other to help users understand the model better.)
The text was updated successfully, but these errors were encountered: