Closed davepaiva closed 5 years ago
Your first function is closer to being right. But I think you should look at what the get
function returns. But here's how you can restructure your query:
query.get().then((snap) => {
const docs = snap.docs.map((doc) => {
doc['data'] = doc['data']();
return doc;
});
res.status(200).send({ docs });
}).catch((err)=>{
res.status(500).send(err)
});
Also for your firebase error, you should look at this.
Your first function is closer to being right. But I think you should look at what the
get
function returns. But here's how you can restructure your query:query.get().then((snap) => { const docs = snap.docs.map((doc) => { doc['data'] = doc['data'](); return doc; }); res.status(200).send({ docs }); }).catch((err)=>{ res.status(500).send(err) });
Also for your firebase error, you should look at this.
Thank you so much , it worked as expected! Awesome library 10/10 would recomend
Tu primera función está más cerca de tener razón. Pero creo que deberías mirar lo
get
que devuelve la función . Pero así es como puede reestructurar su consulta:query.get().then((snap) => { const docs = snap.docs.map((doc) => { doc['data'] = doc['data'](); return doc; }); res.status(200).send({ docs }); }).catch((err)=>{ res.status(500).send(err) });
También para su error de Firebase, debe mirar esto .
¡Muchas gracias, funcionó como se esperaba! Impresionante biblioteca 10/10 recomendaría
hello ,
yo shared me, how access your collection in db firestore :)
I get a list of all the documents, the list contains doc Ids , distance and exists but not the actual document data. How to do I get the data? Thanks in advance
UPDATE: Tried the following code:
I get the following error on firebase: