-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.0.3
-
Component/s: None
-
ALL
-
I'm trying to watch a collection, but whenever $changeStream is part of the pipeline, I get the following error:
Command failed (Location40602): $_internalChangeStreamOplogMatch is only valid as the first stage in a pipeline
It doesn't matter what I set $changeStream to, or if it's alone or with other stages in the pipeline, I always get this error. I tried both with Rust and Node.js and I get the same error. This is the Rust code I'm using:
let stream_pipeline = Some(doc! {
"$changeStream" : {
"fullDocument": "updateLookup"
{{ }}}
});
{{}}
let stream = collection.watch(stream_pipeline, None).await?;{}
I'm using the "mongodb" 2.3.1 crate, Rust 1.66.0, MongoDB server 6.0.3, on macOS 13.1, Apple M1 Pro CPU. For Node.js I used the "mongodb" 4.13.0 package with Node.js 16.14.2.