diff --git a/src/change_stream.ts b/src/change_stream.ts index 22330e8595..a89b384936 100644 --- a/src/change_stream.ts +++ b/src/change_stream.ts @@ -705,6 +705,11 @@ export class ChangeStream< return this.cursor?.resumeToken; } + /** Returns the currently buffered documents length of the underlying cursor. */ + get bufferedCount(): number | undefined { + return this.cursor?.bufferedCount(); + } + /** Check if there is any document still available in the Change Stream */ async hasNext(): Promise { this._setIsIterator();