Database Screenshot I currently have a database that is set up like below,
Raters- |_userID1 | |_Car1 | |_Car2 | |_Car3 |_userID2 |_Car1 |_Car2 |_Car3
With Raters being the base collection, the userIDs being the documents, and the Cars being a subCollection of custom Objects. I am trying to retrieve the subcollection for the current user(based on the emailaddress) and populate a recyclerView with it using Firestore UI RecyclerViewAdapter. I understand that I cannot query a subcollection but is there any way I can retrieve the CollectionReference and populate my RecyclerView with that? I need to do it this way because I am trying to implement a "swipe to rate" function and I cannot remove the car object from the RecyclerView without deleting it from the database (which is why I do not have a Car collection) so I plan on removing it from the users "nonRatedCars" subcollection and adding it to a new "ratedCars" subcollection.
Query query = ratersReference.document(usernameIn).collection("nonRatedCars");
final FirestoreRecyclerOptions<Car> options = new FirestoreRecyclerOptions.Builder<Car>()
.setQuery(query, Car.class)
.build();
adapter = new CarAdapter(options);
RecyclerView recyclerView = findViewById(R.id.recycler_view);
llm = new LinearLayoutManager(this);
recyclerView.setLayoutManager(llm);
recyclerView.setAdapter(adapter);