Skip to content

Commit c9f0e66

Browse files
committed
fix(NODE-4887): WIP fix for maps
1 parent 9679ec3 commit c9f0e66

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/parser/serializer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,11 @@ export function serializeInto(
757757

758758
// Get the entry values
759759
const key = entry.value[0];
760-
const value = entry.value[1];
760+
let value = entry.value[1];
761+
762+
if (typeof value?.toBSON === 'function') {
763+
value = value.toBSON();
764+
}
761765

762766
// Check the type of the value
763767
const type = typeof value;

0 commit comments

Comments
 (0)