Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用FIrebase onSnapshot()func在Vue async内合并两个集合_Firebase_Vue.js_Google Cloud Firestore_Merge_Async Await - Fatal编程技术网

使用FIrebase onSnapshot()func在Vue async内合并两个集合

使用FIrebase onSnapshot()func在Vue async内合并两个集合,firebase,vue.js,google-cloud-firestore,merge,async-await,Firebase,Vue.js,Google Cloud Firestore,Merge,Async Await,我有两个收藏。 当其中一个被更新时,我需要向用户显示合并的两个集合 const listRef = await firebase.firestore() .collection("users") .doc(firebase.auth().currentUser.uid) .collection("list") const customListRef = await fireba

我有两个收藏。 当其中一个被更新时,我需要向用户显示合并的两个集合

     const listRef = await firebase.firestore()
          .collection("users")
          .doc(firebase.auth().currentUser.uid)
          .collection("list")
     const customListRef = await firebase.firestore()
          .collection("users")
          .doc(firebase.auth().currentUser.uid)
          .collection("customList")

我使用这个异步基函数来检索数据,但我需要为两个集合都这样做

     const listRef = await firebase.firestore()
          .collection("users")
          .doc(firebase.auth().currentUser.uid)
          .collection("list")
        userRef.onSnapshot(snap => {
          this.userLists = []
          snap.forEach(doc => {
            const flower = doc.data()
            product.id = doc.id
            this.userList.push(flower)
          })
        })
    }
有没有办法只用一个异步/等待函数合并两个不同的集合