I’m in the midst of a rework for one of the contexts in my project. It was previously all fetched and filtered on the front end but I was noticing performance issues with large data sets. I decided to move it so that the data is fetched from a cloud function and stored in the context. Since doing so I’ve noticed that when I update documents that the fields that were previously stored as DocumentReferences and Timestamps are now being saved as maps that essentially mimic timestamps/references. How do I prevent this conversion from happening and ensuring these data types are maintained?
I’d assume that if I fetch a document, make an update to it then update it with updateDoc that the fields would maintain their Timestamp and DocumentReference types – especially when I’m not even updating these fields in particular.
Luke Andrews is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.