Angularfire2 collection snapshotChanges.Detect when no data is returned

Hi

I have a ionic page where I initialize an angularfire2 collection with a filter, then I subscribe to snapshotChanges. What I want is to know if my collection initialization ¡, with a filter, does not return anynithing, to show a message and allow new search, filter, on the same collection.

How can I achieve this?

What do you have so far, source code wise?

Here is my code. Its a resume because i have some functionality encapsulated in a generic repo.
The case is, i know when data is received via observable, and i can operate with it, but I wanna know when the query does not return any data.

let promesa=new Promise((resolve, reject)=>{
this.genericCol=afs.collection(‘supercolletcion’, ref => ref.where(‘field1’, ‘==’, ‘someuservalue’) );
this.genericSnapShot = this.genericCol.snapshotChanges().pipe(
map(actions => actions.map(a => {
const data = a.payload.doc.data() as any;
const id = a.payload.doc.id;
return JSON.parse(JSON.stringify({ id, …data })) ;
}))
);
this.genericSnapShot.subscribe(ref=>{
console.log(“genericSnapShot”, JSON.stringify(ref));
resolve(ref);
});
console.log(“no data??”);
}).catch(err=>{
console.log(" promise ERR", JSON.stringify(err));
})
return promesa;

thanks