繁体   English   中英

Nuxt Firebase 使用 where

[英]Nuxt Firebase using where

我正在尝试使用 nuxt firebase 从 firebase 返回文档,并且需要包含 where 但我收到以下错误:

TypeError: this.$fireModule.firestore.FieldPath.assess is not a function. (In 'this.$fireModule.firestore.FieldPath.assess()', 'this.$fireModule.firestore.FieldPath.assess' is undefined)

从我读到的我必须使用 this.$firemodule 但仍然不适合我

我的代码如下:

this.$fire.firestore.collection('lights')
    .where(this.$fireModule.firestore.FieldPath.assess(), '==', 'ZxBc9dMxVdodbHtnAf5g')
    .get()
    .then(snapshot => {...

我在 Nuxt.config.js 中启用了功能

过于复杂了

.where('assess', '==', this.$route.params.id)
    .get()

作品

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM