Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement filters for MongoDBAtlasVectorSearch #1142

Merged
merged 10 commits into from
Sep 5, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ function toMongoDBFilter(filters?: MetadataFilters): Record<string, any> {
return { $or: filters.filters.map(createFilterObject) };
}

console.debug("filters.condition not recognized. Returning empty object");
return {};
throw new Error("filters condition not recognized. Returning empty object");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning empty object doesn't make sense anymore, how about:

Suggested change
throw new Error("filters condition not recognized. Returning empty object");
throw new Error("filters condition not recognized. Must be AND or OR");

}

/**
Expand Down