We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68fc2f7 commit a736ddbCopy full SHA for a736ddb
src/tools/mongodb/read/aggregate.ts
@@ -352,8 +352,10 @@ Returning ${documents.length} documents${appliedLimitText ? ` ${appliedLimitText
352
): ConnectionMetadata | AutoEmbeddingsUsageMetadata {
353
const [maybeVectorStage] = args.pipeline;
354
if (
355
- maybeVectorStage &&
356
- (maybeVectorStage as z.infer<typeof VectorSearchStage>)?.["$vectorSearch"]?.embeddingParameters &&
+ maybeVectorStage !== null &&
+ maybeVectorStage instanceof Object &&
357
+ "$vectorSearch" in maybeVectorStage &&
358
+ "embeddingParameters" in maybeVectorStage["$vectorSearch"] &&
359
this.config.voyageApiKey
360
) {
361
return {
0 commit comments