Hi, for pagination, when i make search using atlas search with a limit in aggregation, i also need the total count of documents found for my search, my code in nodejs-
assets = await Asset.aggregate([
{ $search:{
index: 'assetsSearch',
text: {
query: [search_query],
path: 'name',
fuzzy: { maxEdits:2, prefixLength:3 }
}}},
// If i use the count operator below, i can get the total documents count, but i will
be using "$limit" in my real code, so then i won't get total count of the documents
for my search.
{$count: 'totalAssetsCount'}
])
please give me solution for it.