diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx index 1f0148a5a..47219274b 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTabV2.tsx @@ -1055,8 +1055,6 @@ export const DocumentsTabComponent: React.FunctionComponent { - let columnDefinitions: ColumnDefinition[] = Object.keys(document).map((key) => - key === "id" - ? { id: key, label: isPreferredApiMongoDB ? "_id" : "id", group: undefined } - : { id: key, label: key, group: undefined }, - ); + let columnDefinitions: ColumnDefinition[] = Object.keys(document) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + .filter((key) => typeof (document as any)[key] === "string" || typeof (document as any)[key] === "number") // Only allow safe types for displayable React children + .map((key) => + key === "id" + ? { id: key, label: isPreferredApiMongoDB ? "_id" : "id", group: undefined } + : { id: key, label: key, group: undefined }, + ); if (showPartitionKey(_collection, isPreferredApiMongoDB)) { columnDefinitions.push(