-
Notifications
You must be signed in to change notification settings - Fork 76
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
Avoid storing reserved fields in document #207
Comments
Interesting 🤔 Do you know if there's any documentation that says that id should not be used in firestore documents? |
No, I am only basing this on the warning from
Works fine for me, but is a little bit of a forced workaround. Maybe we should do the same as |
Yeah, maintaining a list of reserved fields can be done. I'm kind of interested about the |
+1 We need a way to exclude id field to stay consistent with documents that were not created with fireorm. Currently we are monkey-patching toSerializableObject to exclude id which does not sound like a good idea. |
As of now I don't have time to finish this issue @glebbash :( From design perspective |
Creating or updating documents adds the
id
field to the actual document.There are certain reserved fields in Firestore that should not exist within the document.
The package
@nandorojo/swr-firestore
will warn you when it finds documents that contain one of the following reserved fields:exists, id, hasPendingWrites
.It still works, but it is annoying to see this warning when using this package.
Could we get an option to prevent storing
id
field within the document?When creating documents normally, through
firestore.collection('name').add(...)
, the id field is not added to the document.I think the same should apply for this package.
The text was updated successfully, but these errors were encountered: