title: How do I query all documents in a Firestore collection for all strings in an array?
body: <p>I have an array of UIDs, and I want to query my root Users collection for documents containing a user object equal to each UID in my array. Right now my code looks like this:</p>
  
  <pre><code>-(void)queryFriendsOfCurrentUser{
  
      FIRUser *user = [[FIRAuth auth] currentUser];
      NSMutableArray *friendsUIDArray = [[NSMutableArray alloc] init];
  
          for (NSString *friend in friendsUIDArray){
              [[[self.db collectionWithPath:@"Users"] queryWhereField:@"uid" isEqualTo:friend] getDocumentsWithCompletion:^(FIRQuerySnapshot * _Nullable snapshot, NSError * _Nullable error) {
                  if (error != nil) {
                      NSLog(@"Error getting documents: %@", error);
                  } else {
                      for (FIRDocumentSnapshot *document in snapshot.documents) {
  
                          NSDictionary *object = document.data;
                          [self.friendArray addObject:object];
                  }
              }
          }];
      }
  }
  </code></pre>
  
  <p>In many instances my array may contain 20+ UIDs. Am I making excessive database calls having my <code>getDocuments()</code> inside a for loop?</p>