I am using mongoDB as a queue and it is working quite well. I am
using findAndModify with the remove flag set to true to return a
single element and immediately remove it from the collection. What
I'd like to do is be able to fetch and delete several items at once,
or atleast to minimize the number of calls done to the mongo server.
What would be the best way to simulate a 'remove' with a limit?
Before mongodb I used mysql and I would do something like:
update jobQ set worker = %s order by insertTime limit 20
select * from jobQ where worker = %s
delete from jobQ where worker = %s
once a set of jobs were assigned to a particular worker there was no
way for another worker to pick them up etc ... I'd like to repro the
above three lines in mongo.
Thanks!
ttyl
Dima
"The price of reliability is the pursuit of the utmost simplicity.
It is a price which the very rich find the most hard to pay."
(Sir Antony Hoare, 1980)
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mongodb-user?hl=en.
>
>