On Aug 25, 2:16 am, Dwight Merriman <
dwi...@exch.alleycorp.com> wrote:
> I will look tomorrow to see how hard this would be to add (multi-update
> support)
>
> On 8/24/09 8:05 PM, "Dwight Merriman" <
dwi...@10gen.com> wrote:
>
>
>
>
>
> >update works on a single object. perhaps in the future it should
> > allow updating many objects with things like $set -- originally those
> > operations didn't exist so that didn't make sense.
>
> > for now you can use db.eval() to do a series of updates server-side.
> > here's an example in shell syntax:
>
> >> db.foo.find()
> > {"_id" : ObjectId( "4a932a282130f2104ff63022") , "x" : 1}
> > {"_id" : ObjectId( "4a932a292130f2104ff63023") , "x" : 3}
>
> >> function f() { db.foo.find().forEach( function(o){o.y="abc";db.foo.save(o);}
> >> ) }
>
> >> db.eval(f)
> > null
>
> >> db.foo.find()
> > {"_id" : ObjectId( "4a932a282130f2104ff63022") , "x" : 1 , "y" :
> > "abc"}
> > {"_id" : ObjectId( "4a932a292130f2104ff63023") , "x" : 3 , "y" :
> > "abc"}
>
> > On Aug 24, 5:28 pm, Lincoln <
linxbet...@gmail.com> wrote:
> >> Hey guys,
> >> doc for query look like? Ideally, could someone show me what it would look
> >> like with the java driver?
>
> >> I was trying to do the following:
> >> db.collection.update(new DBO(), new DBO("field", "value"), false, false)
>