You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working on a project that extensively uses cloud_firestore_odm, and have come across a scenario wherein I would like to keep the field decorated with @Id in the Firestore document data.
Here, the uid field, which is the @Id decorated in my case, is consistently removed with every document update.
Upon referring to the Firestore documentation, it becomes evident that the @Id field is not included in the Firestore object when encoded, by default. However, my requirement contradicts this default behavior, and I would like to preserve the @Id field.
Could anyone guide me on how to stop cloud_firestore_odm from removing the uid field, which is marked with @Id annotation, when encoding a Document? Any input on this would be greatly appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Flutterfire Community,
I am currently working on a project that extensively uses
cloud_firestore_odm
, and have come across a scenario wherein I would like to keep the field decorated with@Id
in the Firestore document data.The issue arises with the generated code:
Here, the
uid
field, which is the@Id
decorated in my case, is consistently removed with every document update.Upon referring to the Firestore documentation, it becomes evident that the
@Id
field is not included in the Firestore object when encoded, by default. However, my requirement contradicts this default behavior, and I would like to preserve the@Id
field.Could anyone guide me on how to stop cloud_firestore_odm from removing the
uid
field, which is marked with@Id
annotation, when encoding a Document? Any input on this would be greatly appreciated.Thanks in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions