Reputation: 1
I am currently working on an app in which a user answers a list of questions, and the answers are stored in Firestore. But I need to be able to write data to Firestore offline and while writing to the database once is fine, I Cant write multiple requests to the database without it overwriting the current cache.
With how the code was written, when I enable offline persistence, the data in the cache is overwritten every time a new write request is made. So how would I cache multiple writes without overwriting what is currently cached ?
Upvotes: 0
Views: 29
Reputation: 138979
If the local cache of the database isn't what you need, then you should consider creating your own mechanism for caching using the Room persistence library. You can do as many operations as you want, and later when you consider, you can add it to Firestore.
Upvotes: 0