So I have code below get the FirebaseObjectObservable. But the path is dynamic as it might not even there yet. So if the path is not there, I want to create that path. But if it is there, I want to update / patch the data.
this.userLocationDetail = this.af.database.object('/userProfile/' + uid + '/bbwList/' + afLocationId);
if (this.userLocationDetail) {
console.log('Data is found');
} else {
console.log('Data not found');
}
The problem is if (this.userLocationDetail) will always be true. How can I look into the observable and make sure it is empty?