-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 1.0.0
-
Component/s: None
I'm trying to use a tailable cursor on a capped collection.
All documents in collection are read correctly and after that cursor is stuck and does not return new documents when they are inserted.
Example code to reproduce the issue:
```
use tokio::prelude::*;
use mongodb::Client;
use mongodb::options::{FindOptions, CursorType};
use std::error::Error;
use std::time::Duration;
use futures::stream::StreamExt;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
println!("Hello, world!");
let client = Client::with_uri_str("mongodb://localhost:27017/").await?;
let col_events = client.database("notifications").collection("events");
let options = FindOptions::builder()
.cursor_type(CursorType::TailableAwait)
.max_await_time(Duration::from_secs(1))
.build();
let mut cursor = col_events.find(None, Some(options)).await?;
while let Some(doc) = cursor.next().await
{ dbg!(doc); } println!("Done");
Ok(())
}
```
I'm using unstable driver from:
[[package]]
name = "mongodb"
version = "0.9.1"
source = "git+https://github.com/mongodb/mongo-rust-driver#90925b9f2e68b9dcbefba6994d35345a5056867a"
Related to #RUST-212