0

If I have a bunch of documents in the Users collection and they all have a localUserId key and a Bool called isOnline, how can I query Firestore for only documents within a set of localUserIds where isOnline = true

let localUserIds = ["abc", "def", "ghi"]

let db = Firestore.firestore()
db.collection("Users")
   .whereField("localUserId", ???: localUserIds) // this is the unknown part
   .whereField("isOnline", isEqualTo: true)
   .getDocuments { snapshot, error in 
       ...
   }
Zack Shapiro
  • 6,648
  • 17
  • 83
  • 151

0 Answers0