vedartm / paginate_firestore

A flutter package to simplify pagination with firestore data 🗃
https://pub.dev/packages/paginate_firestore
MIT License
113 stars 136 forks source link

Retrieving a subcolletion #24

Closed Miguel-cancino closed 2 years ago

Miguel-cancino commented 4 years ago

How retrieve a subcollection? The example just show a simple query.

claudemircasa commented 4 years ago

I believe it is simple, the firestore documentation shows that you can search for sub-collections in this way (example):

Firestore.instance.collection('users').doc(Firestore.instance.currentUser.uid).collection('orders').orderBy('id', descending: true);
Miguel-cancino commented 4 years ago

Thank you. I've already tried, but I need to retrieve all users documents, not just current user´s documents.

vedartm commented 3 years ago

If you are talking about Collection group queries, then the query goes like

Firestore.instance.collectionGroup('orders').getDocuments()