I'm trying to dynamically generate queries.
I have a big object of things like location and price data. But I get that data from the request. How can I dynamically make use of that data if every query thing is a chained function?
Ideally I'd like to convert something like this...
const wheres = [
{ key: 'price', operator: '>=', value: '1000' },
{ key: 'price', operator: '<=', value: '2000' }
]
...to...
admin
.firestore()
.collection(`rentals`)
.where(`price`, `>=`, `1000`)
.where(`price`, `<=`, `2000`)