-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
id field value is override by vuefire #1472
Comments
The Regarding other properties, that same page also explains how to add custom data to the document. Adding everything by default would bloat the data, especially in SSR. |
Yes, it may be annoying, but it at least does not break things which is more importance.
If this issue is not planned to be fixed, this should be stated in document with highlighting. But I think, Vuefire should use Since useDocument() return VueFirestoreDocumentData, defining a global firestore converter does not make typescript happy when reading other field. Type casting or bypassing the TS rule every where is needed, it is annoying. I really hope this issue be fixed, this commit may help. |
For the moment, |
Reproduction
Please see step 2
Steps to reproduce the bug
id
such asExpected behavior
id should be
123
Actual behavior
id is overrided to document ID (
AnyDoc
)Additional information
It is good for vuefire to provide access to document id but I think it should not use a normal field name

id
, since it is a valid field name for firestore too. Use a special field name such as.id
can avoid conflict with document data.One constraint about the firestore document field name is 'not start with a dot(
.
)'.Also, as suggested in #180, I think the following properties should be exposed to the vuefire data object as non-enumerable properties:
The text was updated successfully, but these errors were encountered: