I am trying to develop a system such that users are assigned tickets, and I get all tickets that are assigned for such user.

So, a user may be assigned 5 different tickets on 3 different projects. I am trying to fetch all tickets where the field of "assignee" equals [Name of user]. The screenshots I showed are the projectTickets for just one project. I need a way to fetch what I requested, and above it, put a for loop to go through every project. In every project name (d0c), there is a collection titled "projectTickets".
To get all projectTickets across all projects where 'assignee' = 'aa', use this:
db.collectionGroup("projectTickets").where("assignee", "==", "aa")
.get()
.then(function(querySnapshot) {
// below is your loop
querySnapshot.forEach(function(doc) {
console.log(doc.id, " => ", doc.data());
});
})
.catch(function(error) {
console.log("Error getting documents: ", error);
});
This will require indexes.
For user named 'aa', the above function should get all tickets on all projects.