I am trying to use. sync API in mongo 1.2.0.
Below is my cargo.toml file where I mention the mongo based on the document, it throws compile time error.
[dependencies.mongodb]
version = "1.2.0"
default-features = false
features = ["sync"]
I am getting the following error
Compiling mongodb v1.2.0
error: tokio-runtime and sync can't both be enabled; either disable sync or set default-features = false in your Cargo.toml
--> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/mongodb-1.2.0/src/lib.rs:164:1
|
164 | / compile_error!(
165 | | "tokio-runtime and sync can't both be enabled; either disable sync or set
166 | | default-features = false in your Cargo.toml"
167 | | );
| |__^
error: aborting due to previous error
The default set of enabled features in the wither crate is the wither/tokio-runtime feature, which in turn depends on the mongodb/tokio-runtime feature. You can only enable one of the mongodb/tokio-runtime, mongodb/sync and mongodb/async-std-runtime features at the time, but you enabled the first two, hence the error.
I don't think you can use wither in sync mode.
(This kind of exclusive feature flag is considered bad practice, and I think it is a mistake for mongodb to use this pattern.)