From e2b76face95a6ad62ce9880ef4f050767261b044 Mon Sep 17 00:00:00 2001 From: Gino Heyman Date: Tue, 10 Feb 2026 21:38:04 +0100 Subject: [PATCH] feat(NODE-7441): add `ChangeStream.bufferedCount` --- src/change_stream.ts | 5 +++++ 1 file changed, 5 insertions(+) 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();