0
votes

This is my data structure. Here are the list of users documents.enter image description here

and here is the subcollection in every document.enter image description here

The subcollection is containing strongly typed document which is form.

What I want is to fetch form document (not for the current user) from subcollection workerField from every users document. what is the implementation method.

1

1 Answers

0
votes

If you want to load documents from all workerField collections you can use a so-called collection group query.

So something like:

var docs = await FirebaseFirestore.instance
      .collectionGroup('workerField')
      .snapshots();

See my answer here for another example: Is wildcard possible in Flutter Firestore query? and more from these search results.