Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/tools/mongodb/metadata/collectionSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

protected async execute({ database, collection }: ToolArgs<typeof DbOperationArgs>): Promise<CallToolResult> {
const provider = await this.ensureConnected();
const documents = await provider.find(database, collection, {}, { limit: 5 }).toArray();
const documents = await provider.aggregate(database, collection, [

Check failure on line 16 in src/tools/mongodb/metadata/collectionSchema.ts

View workflow job for this annotation

GitHub Actions / check-style

Replace `⏎············{·$sample:·{·size:·50·}·},⏎········` with `{·$sample:·{·size:·50·}·}`
{ $sample: { size: 50 } },
]).toArray();
const schema = await getSimplifiedSchema(documents);

const fieldsCount = Object.entries(schema).length;
Expand Down
Loading