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

Adding the key for the first time #40

Open
hsouiri97 opened this issue Aug 21, 2019 · 2 comments
Open

Adding the key for the first time #40

hsouiri97 opened this issue Aug 21, 2019 · 2 comments

Comments

@hsouiri97
Copy link

when you add a document for the first time you can not see the id in the firestore console, only you can see it when you update the doc.

@amranidev
Copy link
Contributor

HI @hsouiri97 can you provide an example?

@hsouiri97
Copy link
Author

hsouiri97 commented Aug 29, 2019

@amranidev when we call this function this.$firestore.persons.add() for the first time we can save the object in firestore however we can not see the id or ".key" value in firestore console, but if we looped trough the list of objects in our application and console log them we can see that they have and id value, so then if we call this.$firestore.persons.doc(person['.key']).update() we can see that the ".key" value has been added to firestore console.

1. Adding the object with this.$firestore.persons.add()

issue1

2. Looping through the objects and console log them so we can see the id value:

issue2

3. Calling the this.$firestore.persons.doc(person['.key']).update() function and checking the firestore console to see that the id has been added

issue3

Note that I used this Vue.use(VueFirestore, { key: 'id', enumerable: true })
to customize the name of the .key property.

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