use mongors::*; use bsonrs::doc; fn main() { let client = Mongo::new("mongodb://localhost:27017/?maxpoolsize=10").unwrap(); let db = client.db("test"); let collection = db.collection("test"); let mut cursor = collection.find(doc!{}, None, None).unwrap(); for doc in &mut cursor { println!("{:?}", doc); } if let Some(err) = cursor.error_document() { println!("{:?}", err); } }