[DOCS-5955] mongorestore --w vs --writeConcern Created: 03/Aug/15  Updated: 30/Oct/23  Resolved: 29/Oct/17

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: Kevin Pulo Assignee: Kay Kim (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by DOCS-8641 --w doesn't exist for mongorestore (s... Closed
Related
Participants:
Days since reply: 7 years, 34 weeks, 5 days ago

 Description   

The interactions are not clear between mongorestore --w (which is the way to do it in MongoDB 2.6 and earlier):

http://docs.mongodb.org/manual/reference/program/mongorestore/#cmdoption--w

and mongorestore --writeConcern (which is new in 3.0):

http://docs.mongodb.org/manual/reference/program/mongorestore/#cmdoption--writeConcern

In particular, --w defaults to 0 but --writeConcern defaults to "majority". Apparently --writeConcern "wins" in 3.0, but this isn't clear.

It's also not clear what happens if both are specified, or if there is any preference between the two. Presumably "--w N" is (now) merely a shortcut for "--writeConcern '{ w: N }'"? And the --w default is antiquated and no longer applies?



 Comments   
Comment by Andrew Ryder (Inactive) [ 18/Jun/16 ]

--w does not exist in 3.0 or 3.2.

>mongorestore --version
mongorestore version: 3.0.0
git version: e35a2e87876251835fcb60f5eb0c29baca04bc5e
 
>mongorestore --w 3
2016-06-18T13:40:19.165+1000    error parsing command line options: unknown option "w"
2016-06-18T13:40:19.165+1000    try 'mongorestore --help' for more information

Then:

>mongorestore --version
mongorestore version: 3.2.0-rc5
git version: 6186100ad0500c122a56f0a0e28ce1227ca4fc88
 
>mongorestore --w 3
2016-06-18T13:40:34.349+1000    error parsing command line options: unknown option "w"
2016-06-18T13:40:34.349+1000    try 'mongorestore --help' for more information

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