Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
2.5.5
-
db version v2.5.5-pre-
2014-01-23T20:40:17.533-0500 git version: d91079d6d0d85b070c7d94376a441a7d41ae49f5
-
Replication
-
ALL
Description
This command:
> db.test.runCommand({insert : "test", documents : [{}], writeConcern : {} } )
|
returns:
{ "n" : 1, "ok" : 1 }
|
Expected result:
{
|
"ok" : 0,
|
"errmsg" : "'writeConcern' field is set to a document that is missing required fields",
|
"code" : 9
|
}
|
Other unsupported fields or value types in the writeConcern document will generate the incorrect response as well:
> db.test.runCommand({insert : "test", documents : [], writeConcern : { wtimeout : true} } )
|
> db.test.runCommand({insert : "test", documents : [], writeConcern : { foo : 1} } )
|
> db.test.runCommand({insert : "test", documents : [], writeConcern : { j : false} } ) // not sure why this one is treated this way, as this is a legal value for j
|
The command also allows extra unsupported fields like "foo" below:
> db.test.runCommand({insert : "test", documents : [], foo : 1} )
|
{ "ok" : 1, "n" : 0 }
|
Not sure if this is the intended behavior.
Attachments
Issue Links
- is related to
-
SERVER-43185 write concern accepts malformed documents
-
- Closed
-
- related to
-
DRIVERS-131 Drivers should only send {w:1} if and when the user has specified.
-
- Closed
-