title: Android Firestore subcollections into RecyclerView
body: <p>I am currently working on a Rental Car app in Java Android Studio. For the project database, I am using Cloud Firestore. My database is structured like so:</p>
  <p><a href="https://i.stack.imgur.com/kVkYA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kVkYA.png" alt="collection" /></a></p>
  <p>Subcollection:
  <a href="https://i.stack.imgur.com/1TD8R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1TD8R.png" alt="subcollection" /></a></p>
  <p>The first image is represented by the collection of Cars with multiple documents with random ID (each represents a car). Every car has a unique subcollection called bookings where are saved in random ID documents details about bookings made to that specific car (the second image is represented by an example of a booking subcollection).</p>
  <p>I am currently working at a &quot;Booking history&quot; section. There, I want to put the current user's booking history (highlighted with red in the second image) in a RecyclerView. I know how to iterate between all cars and their subcollection and put and if(bookedBy == currentUser) condition to obtain only the cars booked by the current user.</p>
  <p>But my question is: How can I save those in a RecyclerView? I want to save data highlighted in red (second image) in the RecyclerView if our previous condition is met. I don't know what query to put in the Firestore adapter. I was thinking about saving all the cars booked by the user and their dates in an object or something like this but I can't figure it out. Can anyone help me, please?</p>
  <p>Thank you!</p>