Sorting big mongodb collection

System Information
  • Strapi Version: 3.6.8
  • Operating System: Windows
  • Database: MongoDB Atlas
  • Node Version:
  • NPM Version:
  • Yarn Version:

So, the error started occurring after migrating +26000 docs to our database, sorting or skipping 50+ record crashes the server with timeout error for ex:
/articles?category.i18name=News&_locale=en&_sort=Date:DESC
or
/articles?category.i18name=News&_locale=en&_start=50
or both together same error
http://localhost:3001/articles?category.i18name=News&_locale=en&_start=0&_limit=5&_sort=Date:DESC

although everything is smooth in the admin area !!

So the problem was with filtering using field in category table “category.i18name” with _id it works but any idea how to index it ?