rules_version = '2';
service cloud.firestore {
  match /databases/{database}/documents {
     // A read rule can be divided into get and list rules
    match /todo/{todo} {
      // Applies to single document read requests
      allow get: if request.auth.uid == resource.data.uid;

      // Applies to queries and collection read requests
      allow list;
    }

    // A write rule can be divided into create, update, and delete rules
    match /todo/{todo} {
      // Applies to writes to nonexistent documents
      allow create;

      // Applies to writes to existing documents
      allow update;

      // Applies to delete operations
      allow delete;
    }

     // A read rule can be divided into get and list rules
    match /users/ {users} {
      // Applies to single document read requests
      allow get;

      // Applies to queries and collection read requests
      allow list;

      // Applies to writes to nonexistent documents
      allow create;
     }

       // A read rule can be divided into get and list rules
    match /chatroom/ {chatroom} {
      // Applies to single document read requests
      allow get;

      // Applies to queries and collection read requests
      allow list;

      // Applies to writes to nonexistent documents
      allow create;

      // Applies to writes to existing documents
      allow update;
     }
  }
}
