i´m doing a webapp with vuejs and firebase. I got stack using filter an array for 'push' into a data table.
i think i follow correctly de instructions of how to use the filter() method, but is not working
methods: {
consulProds {
let resultado = await db.collection('productos')
.get()
resultado.docs.forEach(doc => {
let productosTot = doc.data()
let productosInd= productosTot.filter(producto=>
producto.precio== 99)
this.productosind.push(productosInd)
})
}
}
when i do the 'push' without the line code of 'filter' method and using 'doc.data()', it works and i get the array in my 'data table'. But does not happend anything using the 'filter'.
doc.data().preciothat equals 99?doc.data()so we can help you further?