From 838a80e5c1708b9227410396b8645f7c995be341 Mon Sep 17 00:00:00 2001 From: Eduarda Scharnhorst Date: Fri, 13 Nov 2026 10:16:28 +0000 Subject: [PATCH 1/2] fix(shell-bson-parser): do not treat own _bsontype field as a BSON value in toJSString --- packages/shell-bson-parser/src/stringify.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/shell-bson-parser/src/stringify.ts b/packages/shell-bson-parser/src/stringify.ts index 203e2d74..20cbc448 100644 --- a/packages/shell-bson-parser/src/stringify.ts +++ b/packages/shell-bson-parser/src/stringify.ts @@ -36,7 +36,10 @@ function detectType(value: BSONValue) { function getTypeDescriptorForValue(value: BSONValue) { const t = detectType(value); - const _bsontype = t === 'Object' && value._bsontype; + const _bsontype = + t === 'Object' && + !Object.prototype.hasOwnProperty.call(value, '_bsontype') && + value._bsontype; return { type: _bsontype || t, isBSON: !!_bsontype, From fc77ca96b4c4991f2c404d9c6df45e257d313061 Mon Sep 17 00:00:00 2001 From: Eduarda Scharnhorst Date: Fri, 13 Nov 2026 10:33:26 +0000 Subject: [PATCH 2/2] fix(shell-bson-parser): keep bson 4 Timestamp detection in toJSString --- packages/shell-bson-parser/src/stringify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shell-bson-parser/src/stringify.ts b/packages/shell-bson-parser/src/stringify.ts index 20cbc448..83c2b073 100644 --- a/packages/shell-bson-parser/src/stringify.ts +++ b/packages/shell-bson-parser/src/stringify.ts @@ -38,7 +38,7 @@ function getTypeDescriptorForValue(value: BSONValue) { const t = detectType(value); const _bsontype = t === 'Object' && - !Object.prototype.hasOwnProperty.call(value, '_bsontype') && + !Object.prototype.propertyIsEnumerable.call(value, '_bsontype') && value._bsontype; return { type: _bsontype || t,