Details
-
New Feature
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
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.