Technically, Firestore Android/Web API doesn't support get multiple documents by ids, though firestore server/backed API support get multiple docs.
You can simulate get multiple documents api by running multiple get call simultaneously using coroutines.
dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.2.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.2.1'
}
val COLLECTION_NAME = ...fun getMutipleDocs(ids: List<String>): List<Deferred<DocumentSnapshot>> { val firestore = FirebaseFirestore.getInstance() return ids.map { id -> firestore.collection(COLLECTION_NAME).document(id).get().asDeferred() }}
launch(Dispatchers.Default) { val ids = ... val docs = viewModel.getMutipleDocs(ids).awaitAll()}