Where
carlosasjr opened this issue · 3 comments
carlosasjr commented
Is possible create this code?
const products = await db.collection(${ RESOURCE }
)
.where("company_id", "==", company_id)
.where("inactive", "==", 0)
.orderBy("description")
.get();
samuk190 commented
I've added filtering collection support, can you check if it works for your use case?
Mashiane commented
Hi, can you please provide an example of how to use this where filter?
Thanks
samuk190 commented
Try this :)
Hi, can you please provide an example of how to use this where filter?
Thanks
db.collection('users')
.doc({id: 1}).get().then(user => {
const u = user
db.collection('orders')
.get({keys: false, filter: {userId: u.id}}).then(orders => {
u.orders = orders
console.log(u)
})
})