[SERVER-6996] findAndModify triggering assertion but still modifying record Created: 10/Sep/12  Updated: 10/Sep/12  Resolved: 10/Sep/12

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

Type: Bug Priority: Major - P3
Reporter: Stephen Lee Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Operating System: ALL
Participants:

 Description   

I successfully replicated the following error reported on GG:

https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/0V8Irg2rZgI

------------------------------

i test the code in mongo shell,and php driver, get the same result

it seems like some bug happened on server

=====
> uo
{ "_id" : 80, "bag" :

{ "bm1" : 10, "bm2" : 1 }

, "money" : 450 }
> db.s1_users.save(uo)
> cmd
{
"findAndModify" : "s1_users",
"query" : {
"money" :

{ "$gte" : 50 }

,
"bag.bm1" :

{ "$gte" : 10 }

,
"_id" : 80
},
"update" : {
"$inc" :

{ "money" : -50, "bag.bm1" : -10 }

},
"fields" :

{ "money" : 1, "bag.bm1" : 1 }

,
"new" : true,
"upsert" : true
}
> db.runCommand(cmd)
{
"errmsg" : "exception: assertion src/mongo/db/commands/find_and_modify.cpp:184",
"code" : 0,
"ok" : 0
}

//the data was modified

db.s1_users.findOne({_id:80,'money':{'$gte':50}});
{ "_id" : 80, "bag" :

{ "bm1" : 0, "bm2" : 1 }

, "money" : 400 }

if i remove the query condition
"bag.bm1" :

{ "$gte" : 10 }

it worked .



 Comments   
Comment by Eliot Horowitz (Inactive) [ 10/Sep/12 ]

SERVER-6909

Generated at Thu Feb 08 03:13:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.