[SERVER-6433] .update() with incorrect arguments results in assertion failue Created: 12/Jul/12  Updated: 04/Sep/14  Resolved: 04/Sep/14

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

Type: Bug Priority: Minor - P4
Reporter: Doug Hudson Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

> db.serverBuildInfo()
{
"version" : "2.1.0",
"gitVersion" : "d674c681170337e3dfc34ae796b06fdde5ac05dd",
"sysInfo" : "Linux ip-10-110-9-236 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41",
"versionArray" : [
2,
1,
0,
0
],
"bits" : 64,
"debug" : false,
"maxBsonObjectSize" : 16777216,
"ok" : 1
}


Operating System: ALL
Participants:

 Description   

Accidentally issued wrong arguments to update(). There is no explicit check for arguments before the assertion fails.

> db.boundaries.update({$unset:{num_shapes:1}})
assert failed : need an object
Error("Printing Stack Trace")@:0
()@src/mongo/shell/utils.js:37
("assert failed : need an object")@src/mongo/shell/utils.js:58
(undefined,"need an object")@src/mongo/shell/utils.js:66
([object Object])@src/mongo/shell/collection.js:197
@(shell):1

Thu Jul 12 16:06:16 uncaught exception: assert failed : need an object


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