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:
or both together same error

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 ?