Ariel Castilho
Ariel Castilho

Reputation: 19

Ionic 4 Firebase Return

I'm using a function to check whether the values (value) in the documents within my collection are the same as in a string arrays (this.values), but I'm unable to return the true values for this condition in string format.

Function() {

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

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

if(res.length > 0

{

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

}

});

}

Result

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

What should I do to return the values in string format?

Upvotes: 0

Views: 37

Answers (1)

Aya Ashraf
Aya Ashraf

Reputation: 46

did you try JSON.stringfy(res); ?

Upvotes: 1

Related Questions