Vuefire: `ID` property is reserverd?

Created on 15 Jan 2020  路  3Comments  路  Source: vuejs/vuefire

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.

Most helpful comment

Updated the link, the hash was wrong!

All 3 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

konato picture konato  路  7Comments

RobertAKARobin picture RobertAKARobin  路  4Comments

weavermedia picture weavermedia  路  4Comments

amesas picture amesas  路  5Comments

cairinmichie picture cairinmichie  路  6Comments