Hello,
For context, here’s the structure of the documents in my collection:
{
_id: ObjectId(),
text: "Bye bye",
embedding: Array,
id: 1,
site: "check"
}
Now I am trying to call the vectorStore.asRetriever() method with the goal of only retrieving documents where site = “check” but I am unable to do so using the following code:
const retriever = await vectorStore.asRetriever({
searchType: "mmr",
searchKwargs: {
fetchK: 2,
lambda: 0.1
},
filter: {
"compound": {
"must": [
{
"text": {
"path": "site",
"query": "check"
}
}
]
}
}
});
Any idea how to achieve the above? A similar question was asked for the Python version and I’ve already tried the suggested approach but to no avail: Filtering the results of Vector Search with LangChain