Skip to content
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

exists, id, hasPendingWrites warning from useDocument #57

Open
gwendall opened this issue Oct 26, 2020 · 2 comments
Open

exists, id, hasPendingWrites warning from useDocument #57

gwendall opened this issue Oct 26, 2020 · 2 comments

Comments

@gwendall
Copy link

gwendall commented Oct 26, 2020

I call useDocument to get some data: const { data } = useDocument<Items>("items/123");.
I get the following warning: [get-document] warning: Your document, 123 is using one of the following reserved fields: [exists, id, hasPendingWrites]. These fields are reserved. Please remove them from your documents.

The actual firestore document doesn't contain these fields.
What do I do wrong ? How can I get the actual saved document ?

@gwendall gwendall changed the title exists, id, hasPendingWrites warning exists, id, hasPendingWrites warning from useDocument Oct 26, 2020
@nandorojo
Copy link
Owner

Duplicate of #49

#46 may be a solution.

@nandorojo
Copy link
Owner

If you use an id field in any of your documents, I suggest removing that. Firestore IDs should be confined to the ID of the document itself. If you want to include an ID field in the document, I recommend naming it something more specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants