UNPKG

firestore-snapshot-utils

Version:
11 lines (10 loc) 421 B
/** * Returns all documents in a flat list from the provided DB queries. * @param queries - The DB queries to get the documents from. Can be a single * query or an array of queries. */ export const getDBSnapshot = async (queries) => { const qs = Array.isArray(queries) ? queries : [queries]; const results = await Promise.all(qs.map((query) => query.get())); return results.flatMap((doc) => doc.docs); };