I want to sort and filter my documents like the below code. But it didn't work. Actually, when I add a new document I can't see it in real-time.
val query: Query = FirebaseFirestore.getInstance()
.collection("Lessons")
.whereEqualTo("tag",tag)
.orderBy("order",Query.Direction.ASCENDING)
val options: FirestoreRecyclerOptions<Model> = FirestoreRecyclerOptions.Builder<Model>()
.setQuery(query, Model::class.java)
.build()
adapter = KonuRecyclerAdapter(options,tag,konuBasligi)
binding?.konularAnaRecyclerView?.adapter = adapter
But when I comment "whereEqualto" line I can see new documents (Newly added). After that, if I uncomment this line again, I can see this document too. I want that when I add a new document it will show in real-time. Please help me with this problem. You can warn me of any mistakes that I did. Any help will be appreciated!!!