I need to change the String field stored in Firestore to a List
The idea that comes to my mind right now is to transform the list when users enter the first screen if it is not yet transformed into a list. However, if you do this, you have to execute the if conditional statement on the first screen every time.
It would be a very, very slight loss in terms of performance, but I think I am not satisfied somehow. Is there a more effective way?
(I put it in MongoDB Tag because thinking that it would be the same in this case)
CodePudding user response:
There isn't any direct way in Firestore to update field type so you'll have to first read value of the string field and then update it back in the document. If you need to fetch that document every time user visits the screen maybe you can just check for field type and run this logic.