How to filter multiple data using cloud firestore in Firebase

Hi everybody, I’m developing an aplication using cloud firestore of firebase and I need to make a dynamic filter using an ion-select with multiple values as in checkbox. The firestore have a tool to make simple and compound queries using the where function (https://firebase.google.com/docs/firestore/query-data/queries) , but I need something more dynamic so that the user can filter one or several values in different fields ​​using the same logic of the code.
Some help?