fix(mongodb): label sampled date and ObjectId fields with BSON types

This commit is contained in:
Loc Nguyen authored and GitHub committed 2026-10-04 16:48:09 +08:00
1 parent ee2573f7db
commit a28b5d5280
4 files changed
+108 -1

No files matched your search

+2 -1
View File
@@ -8817,7 +8817,8 @@ export const useConnectionStore = defineStore("connection", () => {
} catch {
result = await api.mongoFindDocuments(connectionId, database, collection, 0, 100, "{}");
}
const fields = inferMongoCompletionFields(result.documents ?? []);
const sampled = result.extended_documents?.length === result.documents.length ? result.extended_documents : result.documents;
const fields = inferMongoCompletionFields(sampled ?? []);
mongoCompletionFieldsCache.value[cacheKey] = fields;
evictOldestCacheEntries(mongoCompletionFieldsCache.value, COMPLETION_CACHE_MAX);
return fields;