This service can be used to:
root: Set the working directory of OpenDALconnection_string: Set the connection string of mongodb serverdatabase: Set the database of mongodbcollection: Set the collection of mongodbkey_field: Set the key field of mongodbvalue_field: Set the value field of mongodbuse anyhow::Result; use opendal_service_mongodb::Mongodb; use opendal_core::Operator; #[tokio::main] async fn main() -> Result<()> { let mut builder = Mongodb::default() .root("/") .connection_string("mongodb://myUser:myPassword@localhost:27017/myAuthDB") .database("your_database") .collection("your_collection") // key field type in the table should be compatible with Rust's &str like text .key_field("key") // value field type in the table should be compatible with Rust's Vec<u8> like bytea .value_field("value"); let op = Operator::new(builder)?.finish(); Ok(()) }