[SERVER-47409] writeconcern>1 gives no error on standalone server Created: 08/Apr/20  Updated: 29/Oct/23  Resolved: 08/Jun/20

Status: Closed
Project: Core Server
Component/s: Querying, Shell
Affects Version/s: 4.2.2
Fix Version/s: 4.4.0

Type: Bug Priority: Major - P3
Reporter: Rohit Kumar Assignee: Ryan Timmons
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2020-04-08 at 7.24.22 PM.png    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

db.collection.insert({name:"xyz"},{w:2})

Sprint: STM 2020-06-15
Participants:
Story Points: 3

 Description   

When i query "db.collection.insertOne({name:"xyz"},{w:2})" gives error on standalone server which is correct but "db.collection.insert({name:"xyz"},{w:2})" does not.

 

I got it on mongo enterprise 4.2.



 Comments   
Comment by Githook User [ 08/Jun/20 ]

Author:

{'name': 'Ryan Timmons', 'email': 'ryan.timmons@mongodb.com', 'username': 'rtimmons'}

Message: SERVER-47409 writeconcern>1 gives no error on standalone server
Branch: master
https://github.com/mongodb/mongo/commit/61010cb70fd63bafe4da7e58a1829e0c5538ca46

Comment by Carl Champain (Inactive) [ 08/Apr/20 ]

rht.rajput@yahoo.com,

We are passing this ticket to the appropriate team for additional investigation. Updates will be posted on this ticket as they happen.

Thank you,
Carl
 

Comment by Daniel Pasette (Inactive) [ 08/Apr/20 ]

Hi Rohit,

Looks like you've hit an inconsistency in how insert and insertOne are implemented in the shell. They are both documented to only take a writeConcern document as shown here

It looks like the insert command is ignoring the w:2 that's passed because it's parsing the options differently.

Generated at Thu Feb 08 05:14:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.