Filter based querying

So in my case I have a doctor to fetch. Now I don't know how to do a filter based on these doctors. So should I make a subquery which get all doctor data needed generally. And than on that query based on filter so if filter by price or rating do the actually query. It would be really nice if someone show a code example
Was this page helpful?