use mongors::*; fn main() { let url = uri::Uri::new("mongodb://localhost:27017/?maxpoolsize=10").unwrap(); println!("{:?}", url); let read_preference = url.read_prefs(); println!("{:?}", read_preference); println!("mode: {:?}", read_preference.mode()); println!("staleness: {:?}", read_preference.max_staleness_seconds()); println!("tags: {:?}", read_preference.tags()); println!("{:?}", url.string()); //let url = uri::Uri::new("mongodb://user%40DOMAIN.COM:password@localhost/?authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:other,CANONICALIZE_HOST_NAME:true").unwrap(); let mut url = uri::Uri::new("mongodb+srv://aaa:bbb@aaa.bbb.ccc").unwrap(); println!("{:?}", url); let core_uri = url.as_core(); println!("{:?}", core_uri.mechanism_properties().map(|b| b.as_doc())); println!("{:?}", core_uri.service()); println!("{:?}", url.string()); url.set_database("Aaa"); println!("{:?}", url.database()); }