Use bson from Git for now

pull/2/head
Thijs Cadier 9 years ago
parent 05fcd45602
commit e88e6892f9

@ -10,7 +10,9 @@ license = "MIT"
[dependencies] [dependencies]
libc = "*" libc = "*"
bson = "*"
[dependencies.bson]
git = "https://github.com/zonyitoo/bson-rs.git"
[dependencies.mongo_c_driver_wrapper] [dependencies.mongo_c_driver_wrapper]
path = "mongo_c_driver_wrapper" path = "mongo_c_driver_wrapper"

@ -3,7 +3,7 @@ use std::ptr;
use std::thread; use std::thread;
use mongo_c_driver_wrapper::bindings; use mongo_c_driver_wrapper::bindings;
use bson::{Bson,Document}; use bson::{Bson,Document,oid};
use super::BsoncError; use super::BsoncError;
use super::bsonc; use super::bsonc;
@ -138,7 +138,7 @@ pub struct TailingCursor<'a> {
find_options: FindOptions, find_options: FindOptions,
tail_options: TailOptions, tail_options: TailOptions,
cursor: Option<Cursor<'a>>, cursor: Option<Cursor<'a>>,
last_seen_id: Option<[u8; 12]>, last_seen_id: Option<oid::ObjectId>,
retry_count: u32 retry_count: u32
} }
@ -175,7 +175,7 @@ impl<'a> Iterator for TailingCursor<'a> {
{ {
if self.cursor.is_none() { if self.cursor.is_none() {
// Add the last seen id to the query if it's present. // 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) => { Some(id) => {
let mut gt_id = Document::new(); let mut gt_id = Document::new();
gt_id.insert("$gt".to_string(), Bson::ObjectId(id)); gt_id.insert("$gt".to_string(), Bson::ObjectId(id));

Loading…
Cancel
Save