title: how to update data after collection in firebase firestore - flutter
body: <p>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</p>
  <pre><code>updateIsread(String receiverId, String chatRoomId) async {
      FirebaseFirestore.instance
          .collection(&quot;chatRoom&quot;)
          .doc(chatRoomId)
          .collection(&quot;chats&quot;)
          .where('sendTo', isEqualTo: receiverId);
    }
  </code></pre>
  <p>The problem is that after <strong>.collection(&quot;chats&quot;)</strong> i can't use <strong>.update()</strong>
  Please help me out and this is my firebase structure
  <a href="https://i.stack.imgur.com/uL3W5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uL3W5.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/tB4CX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tB4CX.png" alt="enter image description here" /></a></p>