【问题标题】:Ionic 4 Firebase ReturnIonic 4 Firebase 回归
【发布时间】:2020-06-14 11:22:59
【问题描述】:

我正在使用一个函数来检查我的集合中文档中的值(值)是否与字符串数组(this.values)中的值相同,但我无法返回此条件的真实值字符串格式。

Function() {

this.afs.collection('nameCollection', ref => ref.where( 'value', "in" , this.values

)).snapshotChanges().subscribe(res => {

if(res.length > 0

{

console.log(res.toString()) // <--------------------------

}

});

}

结果

console.log : [object Object],[object Object],[object Object]

我应该怎么做才能以字符串格式返回值?

【问题讨论】:

    标签: firebase google-cloud-firestore ionic4


    【解决方案1】:

    你试过 JSON.stringfy(res); ?

    【讨论】:

      猜你喜欢
      • 2020-06-09
      • 1970-01-01
      • 1970-01-01
      • 2019-03-03
      • 1970-01-01
      • 2020-02-15
      • 2020-05-05
      • 2020-02-15
      • 1970-01-01
      相关资源
      最近更新 更多