Hello ! i’m a beginner with this subject, and i didn’t find the solution for my problem :
I got a query that get post (named pushs in my project) by author’s slug, and by chronological order, with a limit of 5.
When i call this query, in production environment / database, this query is taking so long time, like 8-10s. I did my research and it seems it’s because i have 800+ documents in my collection, and mongo is doing a “collectionScan” to get the push with the good authors.
so i’ve read that to get better performance, i have to create an indexe. So to me, it’s relevant to make an indexe by “author.slug”, because it’s how i call the collection, with the query above . i created it with this command
But with this one, nothing change, the query is taking the same time? what did i wrong ?
Here what a “pushs” looks like :