Firebase firestore Statement where not working

0

IhaveanarrayofpassengersinsideacollectionofthefirebasefirestoreandItrytousewheretofilterthedatatoreceiveonlyrowrecordswheretheuseridisinsidethepassengersarray,butfollowingthefirestorequerydocumentationwhereassuggesteddoesnotworkfollowcodebelow:

initRouteListener=async()=>{constuid=firebase.auth().currentUser.uid;constref=firebase.firestore().collection(linesReference).where('passengers.${uid}',"==", true);
        ref.onSnapshot(
          snapshot => {
            let arrayLength = snapshot.docChanges().length

            snapshot.docChanges().forEach(change => {
              this.isRefreshing = true

              if (change.type === "added") {
                this.lines.push(change.doc.data())
                this.processedItems += 1
              }
              if (change.type === "modified") {
                this.lines[
                  this.lines.findIndex(line => line.id == change.doc.id)
                ] = change.doc.data()
                this.processedItems += 1
              }
              if (change.type === "removed") {
                this.lines.splice(
                  this.lines.findIndex(line => line.id == change.doc.id),
                  1
                )
                this.processedItems += 1
              }

              if (arrayLength == this.processedItems) {
                this.isRefreshing = false
                this.processedItems = 0
              }
            })
          },
          error => {
            console.log(error)
          }
        )
      }
    }

I also tested using .where ( passengers.${uid} , "==", true). Have you ever had this problem?

    
asked by anonymous 03.01.2019 / 13:15

0 answers