Hi!
Using firestore + vuexfire to bind an object with a property called id I'm getting inside this property the value of my document reference.
To bind it, I'm doing something like this
bindFirestoreRef(
'currentUserData',
firestore
.collection(collectionName)
.doc('users')
.collection(currentUserData.username)
.doc('session')
)
I created a action to persist this object as well
The thing is, after binding it, because there are data in my cloudstore I've been able to see this kind of action happening:
vuexfire/SET_VALUE currentUserData {
"administrador": true,
"email": "[email protected]",
"id": "session", // this should be 1 like userId
"logout": false,
"name": "ADMIN",
"userId": 1,
"username": "admin" // same as id
}
I was looking for id references in the source code, but so far I couldn't find anything.
Yes, id is by default reserved. You can override this behavior with
https://vuefire.vuejs.org/api/vuefire.html#options-serialize
Nice, thank you for the quick response @posva!
Updated the link, the hash was wrong!
Most helpful comment
Updated the link, the hash was wrong!