[SERVER-333] mixing $inc and $push Created: 03/Oct/09  Updated: 23/Jul/21  Resolved: 28/Dec/09

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: None
Fix Version/s: 1.3.0

Type: Bug Priority: Minor - P4
Reporter: Eliot Horowitz (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-181 $set with array indexes Closed
Participants:

 Description   

>

{"nIndexesWas" : 1 , "msg" : "all indexes deleted for collection" , "ns" : > "businessinsider.test" , "ok" : 1}

>> db.test.save( { comments: [

{ name: 'blah', rate_up: 0, rate_down: 0, >> rate_ups: [], rate_downs: [] }

] } );
>> db.test.find();
> {"_id" : ObjectId( "4ac811c90516872d71363660") , "comments" : [

{"name" : > "blah" , "rate_up" : 0 , "rate_down" : 0 , "rate_ups" : [] , "rate_downs" : > []}

]}
>> db.test.update( {} , { $inc:

{ 'comments.0.rate_up': 1 }

, $push:

{ >> 'comments.0.rate_ups': 99 }

} );



 Comments   
Comment by auto [ 28/Dec/09 ]

Author:

{'name': 'Eliot Horowitz', 'email': 'eliot@10gen.com'}

Message: fix multiple $inc/$push on same embedded object SERVER-333
http://github.com/mongodb/mongo/commit/0a71e870ced185119b233e941d99bf363cae92cb

Comment by Eliot Horowitz (Inactive) [ 18/Dec/09 ]

this is almost working - but actually exposes a bug

Comment by Eliot Horowitz (Inactive) [ 18/Dec/09 ]

i think SERVER-181 totally solves this actually

Generated at Thu Feb 08 02:53:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.