How to create complex filtering query like youtube search filtering by using node js

I am trouble with complex query like creating youtube search filtering or udemy search filtering . can any one give me idea how to create this ?