Add test for count options

pull/4/head
Thijs Cadier 9 years ago
parent e922adcad6
commit b536f1c048

@ -1,7 +1,7 @@
use bson;
use mongo_driver::CommandAndFindOptions;
use mongo_driver::collection::FindAndModifyOperation;
use mongo_driver::collection::{CountOptions,FindAndModifyOperation};
use mongo_driver::uri::Uri;
use mongo_driver::client::ClientPool;
use mongo_driver::flags;
@ -59,6 +59,11 @@ fn test_mutation_and_finding() {
// Count the documents in the collection
assert_eq!(2, collection.count(&query, None).unwrap());
// Count with options set
let mut count_options = CountOptions::default();
count_options.opts = Some(doc!{});
assert_eq!(2, collection.count(&query, Some(&count_options)).unwrap());
// Find the documents
assert_eq!(
collection.find(&document, None).unwrap().next().unwrap().unwrap().get("key_1").unwrap().to_json(),

Loading…
Cancel
Save