diff --git a/Cargo.toml b/Cargo.toml index 83cd884..cb5af6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,9 @@ license = "MIT" [dependencies] libc = "*" -bson = "*" + +[dependencies.bson] +git = "https://github.com/zonyitoo/bson-rs.git" [dependencies.mongo_c_driver_wrapper] path = "mongo_c_driver_wrapper" diff --git a/src/cursor.rs b/src/cursor.rs index 69dc1f2..cda042d 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -3,7 +3,7 @@ use std::ptr; use std::thread; use mongo_c_driver_wrapper::bindings; -use bson::{Bson,Document}; +use bson::{Bson,Document,oid}; use super::BsoncError; use super::bsonc; @@ -138,7 +138,7 @@ pub struct TailingCursor<'a> { find_options: FindOptions, tail_options: TailOptions, cursor: Option>, - last_seen_id: Option<[u8; 12]>, + last_seen_id: Option, retry_count: u32 } @@ -175,7 +175,7 @@ impl<'a> Iterator for TailingCursor<'a> { { if self.cursor.is_none() { // Add the last seen id to the query if it's present. - match self.last_seen_id { + match self.last_seen_id.take() { Some(id) => { let mut gt_id = Document::new(); gt_id.insert("$gt".to_string(), Bson::ObjectId(id));