For the other folks in the room, Atlas Search allows you to eliminate the sort code here, introduce autocomplete, and speeds up performance dramatically. Available on the free tier. You can read about it here: https://docs.atlas.mongodb.com/atlas-search/
This is very nice and easy to use, good job. Where are you sourcing these hadeeths from? Is there some sort of public API or you compiled all the hadeeths yourself?
Also have you submitted it yet to r/Islam on Reddit? You might get more positive feedback
Thanks! I have scraped Hadiths from various websites. Please see the comment above for the sources. And saved them in MongoDB hosted in mlab. I haven't shared in r/Islam, thanks for the suggestion. Will do it soon.
I have to collect all the Hadiths for indexing in search engines. So in either way (scraping or API) I need all Hadiths in my server. I have gone through their API, it's kind of similar.