refactor(mongo-query): forward the query input without re-listing fields

Now that KtxMongoQueryArgs extends KtxMongoQueryInput and the runner takes
that type, pass the args/input object straight through instead of rebuilding
it field by field. assertSafeConnectionId returns its input verbatim, so the
`{ ...input, connectionId }` spread was re-asserting an equal value.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ga2tvQ2YCEphmY8HM5Guzq
This commit is contained in:
Kevin Messiaen 2026-07-11 21:26:10 +07:00
parent 0e2e6c7d90
commit bcfd562f18
No known key found for this signature in database
GPG key ID: 19FF750A17315202
2 changed files with 2 additions and 8 deletions

View file

@ -16,7 +16,7 @@ export async function runMongoQuery(
`Connection "${connectionId}" driver "${connector.driver}" is not a MongoDB connection; mongo_query serves mongodb connections only.`,
);
}
return await connector.executeQuery({ ...input, connectionId }, { runId: 'mongo-query' });
return await connector.executeQuery(input, { runId: 'mongo-query' });
} finally {
await connector?.cleanup?.();
}

View file

@ -42,13 +42,7 @@ export async function runKtxMongoQuery(
demoConnection = isDemoConnection(args.connectionId, connection);
const createScanConnector = deps.createScanConnector ?? createKtxCliScanConnector;
const result = await runMongoQuery((connectionId) => createScanConnector(project!, connectionId), {
connectionId: args.connectionId,
collection: args.collection,
database: args.database,
pipeline: args.pipeline,
limit: args.limit,
});
const result = await runMongoQuery((connectionId) => createScanConnector(project!, connectionId), args);
const output: KtxResultTable = {
connectionId: args.connectionId,