0

Hello everyone :) I need to perform a join Query with Firestore, with Android Java.

I understood how to do it for JS, thanks to this Post : How to join multiple documents in a Cloud Firestore query?

And here's the JS code :

let loadedPosts = {};
posts = db.collection('posts')
          .orderBy('timestamp', 'desc')
          .limit(3);
posts.get()
.then((docSnaps) => {
  docSnaps.forEach((doc) => {
    loadedPosts[doc.id] = doc.data();
    db.collection('users').child(doc.data().uid).get().then((userDoc) => {
      loadedPosts[doc.id].userName = userDoc.data().name;
    });
  })
});

But, I don't know how to implement this code with Android Java...

I will be very grateful for your help :)

Kolya
  • 99
  • 2
  • 10

0 Answers0