firestore check if document exists in collection code example
Example: realtime firebase database : How to check if document exists
this.realtimedbService.getOneItem(key, 'colection').valueChanges()
.subscribe(
result => {
if (result === null) {
console.log('NOT EXIST');
}
if (result !== null) {
console.log('EXIST');
}
},
error => {
console.log(" EE : ");
console.log(error);
}
);