-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
Reproduced with client version 1.1.1 and mongodb server versionĀ 3.6.18
If a default write concern is set up on client:
let mut opts = ClientOptions::parse(&url).await?;
let wc = WriteConcern::builder().w(Acknowledgment::Majority).journal(true).build();
opts.write_concern = Some(wc);
let client = Client::with_options(opts)?;
And then that client is used to preform a command that doesn't support writeConcern:
client.database(db).collection(coll) .count_documents(filter, None).await?
Command will fail with an error:
Command failed (InvalidOptions): Command does not support writeConcern
I've tried to set some `CountOptions` instead of using None, but it did not help.
Workaround is to do not use a global WriteConcern, and set it on each request when needed, but IMO global wc is there for a reason, and this is a bug. Not sure if this is related to the somewhat ancient version of mongodb server I've tested this on, but it is officially supported by the rust driver as far as I know.