Angularfire2 collection snapshotChanges.Detect when no data is returned


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 => => {
const data = as any;
const id =;
return JSON.parse(JSON.stringify({ id, …data })) ;
console.log(“genericSnapShot”, JSON.stringify(ref));
console.log(“no data??”);
console.log(" promise ERR", JSON.stringify(err));
return promesa;