@Eliot,
Every time we talk about this, I think you mis-understand what I'm
asking for :)
I'm asking for updates against multiple specs, not the "multi" option
as we have it now, but rather, just like in insert, a series of update
instructions that get batch processed. To make it more concrete,
assume that each update instruction is to one item in the database
(making the multi flag irrelevant)). For example, I have a list of
keys that I want to count. Each has a 'counter' key. I want to pour
in the instruction set: "for each of these ids, increment their
counter". Right now, to do this, one has to call Update separately.
When there are tens of thousands of them, the get and release
connection calls, and other overhead adds up!
@Michael
I don't think the $in operator addresses this correctly, since some
keys get
should get upsert/incremented once, some get upsert/incremented dozens
of times.
imagine this:
data = [1,2,2,3,4,4,3,2,3,4,2,1,3,4,4,4,4,5,6,... ]
Goal: count them.
update($in, multi=true) doesn't really handle this, does it?
Maybe stealthily, I'm asking for a cursor that stays open for multiple
instructions,
which I agree *would* complicate things quite a lot!
Almost all of my operations happen to be updates rather than inserts,
so it rubs me a little
rawer than most :)
Anywho, if it's BDFL'd down here, I won't complain about it again for
a while!
GL
On Dec 13, 9:16 am, Michael Dirolf <
m...@10gen.com> wrote:
> why not do a multi-update with $in?
>
> >
mongodb-dev...@googlegroups.com<
mongodb-dev%2Bunsu...@googlegroups.com>
> > .