[SERVER-11482] Minor issues with new delete write command Created: 30/Oct/13  Updated: 11/Jul/16  Resolved: 13/Nov/13

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

Type: Bug Priority: Minor - P4
Reporter: Robert Stam Assignee: Greg Studer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

First issue: if you omit the "limit" field from a delete request, the error message returned erroneously says that "ordered" is mising:

> db.runCommand({
... delete:"testcollection",
... writeConcern : { w : 1 },
... deletes : [{ q : { x : 1 } }, { q : { x : 3 } }]
... })
{ "ok" : false, "errCode" : 99999, "errMsg" : "missing ordered field" }
> db.test.remove

Second issue: the server should accept any numeric type for the limit value. When I sent an Int64 limit I got this error message:

"{ 'ok' : false, 'errCode' : 99999, 'errMsg' : 'wrong type for 'limit' field, expected integer, found limit: 1' }"



 Comments   
Comment by Greg Studer [ 13/Nov/13 ]

commit 049f439ea3c8153d3f46663462c70bdf8f1fb602
Author: Greg Studer <greg@10gen.com>
Date: Wed Nov 6 10:55:56 2013 -0500

SERVER-9469 extract number instead of strictly int for delete limit

Comment by Greg Studer [ 30/Oct/13 ]

Changes have happened since last thursday, so suggest we leave as open until you verify the new build fixes.

Comment by Robert Stam [ 30/Oct/13 ]

I was using the latest Windows 64-bit nightly build available here:

http://www.mongodb.org/downloads

It was dated October 24.

Comment by Greg Studer [ 30/Oct/13 ]

Have you tried this with the latest master build (as of yesterday)? The "limit" mandatory issue is fixed in the server (now is mandatory, and we're reviewing making it numeric, probably will).

From my tests (and christian's, apparently) the first command works fine - if it's still failing for you could you provide a jstest?

Comment by Robert Stam [ 30/Oct/13 ]

The first issue might be a red herring. The docs say that "ordered" is optional and that "limit" is mandatory, but it appears like it's implemented the other way around (in which case the unexpected error message makes more sense).

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