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
Atomically update the least used row in a collection, both returning the document and updating its last_updated (datetime) field to the current datetime
I have read through the tutorial and the API docs and I can't find any way to do this at the moment.
Is it possible to do this in one operation? I need to do this atomically, because I will have hundreds of concurrent async operations working on the same collection.
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
-
Hi all
I would like to do the following:
Atomically update the least used row in a collection, both returning the document and updating its
last_updated
(datetime) field to the current datetimeExample document model:
I want to do something like:
Or:
But neither is valid
I have read through the tutorial and the API docs and I can't find any way to do this at the moment.
Is it possible to do this in one operation? I need to do this atomically, because I will have hundreds of concurrent async operations working on the same collection.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions