Am trying to update my firestore database. It is a chat database where am trying to update the chat message if it is read or unread and this is my code
updateIsread(String receiverId, String chatRoomId) async {
FirebaseFirestore.instance
.collection("chatRoom")
.doc(chatRoomId)
.collection("chats")
.where('sendTo', isEqualTo: receiverId);
}
The problem is that after .collection("chats") i can't use .update()
Please help me out and this is my firebase structure

