diff --git a/packages/shell-bson-parser/src/stringify.ts b/packages/shell-bson-parser/src/stringify.ts index 203e2d74..83c2b073 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.propertyIsEnumerable.call(value, '_bsontype') && + value._bsontype; return { type: _bsontype || t, isBSON: !!_bsontype,