Code Review Asked by nmsdvid on January 14, 2021
I have a simple async/await function which gets data from a firebase endpoint. I would like to know if there is any room for improvement performance wise.
async function getDataById(id) {
const snapshot = await admin
.firestore()
.collection("collection")
.where("id", "==", id)
.get();
const documents = [];
snapshot.forEach((doc) => {
documents.push(doc.data());
});
return documents;
}
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP