javascript - I am getting an Firebase Error: "Unknown field filter op" - Stack Overflow

Does anyone know what the error "FirebaseError: Unknown field filter op" means?I working on

Does anyone know what the error "FirebaseError: Unknown field filter op" means?

I working on a Vue project where I store playlists in a Firestore Database, and I want to make CRUD operations. This error pops up when I try to recieve a single document from the database. I am not sure where to look for the error.

<template>
    <div v-if="playlist">
        <h2> {{ playlist.title }} </h2>
    </div>
</template>

<script>

import db from '../firebase/config'
export default {

  data() {
      return {
          playlist: null
      }
  },
  created(){
      let ref = db.collection('playlists').where('slug', '=', this.$route.params.playlist_slug)
      ref.get().then(snapshot => {
          snapshot.forEach(doc => {
              this.playlist = doc.data()
              this.playlist.id = doc.id
          })
      })
  }
 
}
</script>

<style scoped>

</style>

Does anyone know what the error "FirebaseError: Unknown field filter op" means?

I working on a Vue project where I store playlists in a Firestore Database, and I want to make CRUD operations. This error pops up when I try to recieve a single document from the database. I am not sure where to look for the error.

<template>
    <div v-if="playlist">
        <h2> {{ playlist.title }} </h2>
    </div>
</template>

<script>

import db from '../firebase/config'
export default {

  data() {
      return {
          playlist: null
      }
  },
  created(){
      let ref = db.collection('playlists').where('slug', '=', this.$route.params.playlist_slug)
      ref.get().then(snapshot => {
          snapshot.forEach(doc => {
              this.playlist = doc.data()
              this.playlist.id = doc.id
          })
      })
  }
 
}
</script>

<style scoped>

</style>
Share Improve this question edited Feb 18, 2021 at 15:53 Frank van Puffelen 601k85 gold badges890 silver badges860 bronze badges asked Feb 18, 2021 at 13:04 Marc LiljeqvistMarc Liljeqvist 1252 silver badges11 bronze badges 0
Add a ment  | 

1 Answer 1

Reset to default 6

The operator you use in your query is =, which is not a known query operator for Firestore. Firestore uses == for an equality filter.

So:

db.collection('playlists').where('slug', '==', this.$route.params.playlist_slug)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744834535a4596183.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信