Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-30960

Find and Modify Many

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 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.

            Assignee:
            mark.agarunov Mark Agarunov
            Reporter:
            vdog5@mac.com Victor Stewart
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: