Query Chat Rooms Query all chat rooms owned by the current user

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.
Get Unlimited PRO Access


*Enrollment provides full access to this course (and updates) for life.

Chat List Component

      <li v-for="chat of chats" :key="chat.id">
        <router-link :to="{ name: 'chat', params: { id: chat.id } }">{{ chat.id }}</router-link>

    <button @click="createChatRoom()" class="button">Create New Chat Room</button>

import { db } from '../firebase';

export default {
  data() {
    return { 
        chats: [] 
  firestore() {
    return { 
        chats: db.collection('chats').where('owner', '==', this.uid) 
  methods: {
      async createChatRoom() {
          const newChat = await db.collection('chats').add({
              createdAt: Date.now(),
              owner: this.uid,
              members: [this.uid]


  props: ['uid']



Ask questions via GitHub below OR chat on Slack #questions