Reputation: 3551
I've got a Firestore collection with about 40,000 items that need to be processed and stored in a separate collection: a queue, in other words.
Really I just need to be able to read a doc from the collection without specifying the doc's id, i.e. "pop", since it doesn't matter what document it is.
I don't want to use my own index because it could lose synchronization for any number of reasons, and then I'd have no idea what index to start again on (without manually counting up until it works again!). Any ideas?
Upvotes: 5
Views: 3289
Reputation: 2295
I just created an open-source package to create a queue system using Firestore and Firebase Cloud Functions.
Upvotes: 2
Reputation: 115
I know this question is a bit old but you'd probably want to use a transaction in this instance.
The sequence of events would be something like the following:
Upvotes: 3