-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
Find and Modify Many would go a HUGE way to helping with multi-origin signals that result in unavoidable race conditions.
I have a case where users in motion generate rolling location readings, push them to the server and search for users nearby, and then generate events based on changes from the previous state.
Problem is, each device/user generates location readings totally independently. Thus, there's the huge problem of race conditions generating duplicate events and state-update writes.
The only real solution is to create a pseudo-lock.
Currently, best way to do that is...
FIRST use an update-many operation which finds all other users (documents) within radius, and then writes the searcher's "name" on the document.
then SECOND a find-many operation that gathers and returns all documents with the searcher's "name" on them.
...then carry on with the processing... then remove the searcher's name from all documents.
But if there were a find-and-modify-many operation, those first two steps could be taken care of at the same time. As you can imagine, this series of operations will be carried out a zillion times, so the extra inefficiency will really add up.
- duplicates
-
SERVER-714 Allow findandmodify to retreive more than 1 record at a time
- Open