Here is my function
if(filter.query.category)
{
strCategory = filter.query.category;
strMustData["must"].push({"text": {"path": "category","query": strCategory}});
}
const filteredItems = await collection.aggregate([
{
$search: {
index: "productIndexes",
"compound": {
"must":
strMustData.must
}
}
},
{
$project: {
"_id": 10,
"title": 1,
"object": 2,
"price":3,
"imgArray":6,
"category": 7,
score: { $meta: "searchScore" }
}
}
]).toArray();
return filteredItems;
I pass a category ID and get the data and it returns the data but its only returns 50000 items
there is more than this in the data but i am only returning the 50000 is there a way to remove this limit