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

Option on find() to remove returned documents (for queuing)

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Querying
    • None

    Description

      This was requested on IRC and would make it easy to use MongoDB for queue type systems: multiple consumers could be doing finds() on the queue collection and know that they won't be getting the same document twice.

      I think it's possible to work around the lack of this feature by using update to set some value in the document and then checking again to make sure that your update set the value correctly. If it didn't then somebody else's update succeeded and you can't consume the document. This requires at least two findOne's and an update to get a single document though.

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            mike Michael Dirolf
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: