



To get the desired results from this query, you might check the email address, as you might have a typo, where the “u” is missing. Query queryByEmail = llectionGroup("bookings").whereEqualTo("bookedBy". Can anyone help me, please?įirebaseFirestore rootRef = FirebaseFirestore.getInstance() 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. I don’t know what query to put in the Firestore adapter. 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.īut 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. There, I want to put the current user’s booking history (highlighted with red in the second image) in a RecyclerView. I am currently working at a “Booking history” section.

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). The first image is represented by the collection of Cars with multiple documents with random ID (each represents a car). For the project database, I am using Cloud Firestore. NoteViewModel.getAllNotes().I am currently working on a Rental Car app in Java Android Studio. Moreover, I use DiffUtil to update my recyclerView and I update my Adapter thanks to: noteViewModel = new ViewModelProvider.AndroidViewModelFactory(getApplication()).create(NoteViewModel.class) I use a simple searchview filter system on my MainActivity. I followed a tutorial on youtube ( youtube link) but I do not quite understand how I can filter my recyclerView when the user enters a word since I do not store any list in my Adapter. I decided to optimize my code and therefore switch to liveData.
