Firestore Group by field
问题 Below is my firestore collection structure My vue method to get data fetchResults(){ db.collection('data').onSnapshot((querySnapShot)=>{ let results = []; querySnapShot.forEach(doc=>{ results.push(doc.data()) }) this.record=results; }) } What I want is to query in the document like group by ID and order by sec_id desc . How do I suppose to query like that? So that I will get document grouped by ID field. 回答1: As a NoSQL type database, Cloud Firestore doesn't offer any aggregation queries such