[SERVER-321] Option on find() to remove returned documents (for queuing) Created: 29/Sep/09 Updated: 29/May/12 Resolved: 09/Feb/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Michael Dirolf | Assignee: | Eliot Horowitz (Inactive) |
| Resolution: | Duplicate | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| 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. |
| Comments |
| Comment by Michael Dirolf [ 09/Feb/10 ] |
|
This functionality was implemented with |