Open MarsXan opened 4 years ago
DocumentSnapshot always has value. we can't use this for checking a value exist or not!
db.collection("cities") .document("SF") .rx .getDocument() .subscribe(onNext: { document in if let document = document { print("Document data: \(document.data())") } else { print("Document does not exist") } }, onError: { error in print("Error fetching snapshots: \(error)") }).disposed(by: DisposeBag())
DocumentSnapshot always has value. we can't use this for checking a value exist or not!
db.collection("cities") .document("SF") .rx .getDocument() .subscribe(onNext: { document in if let document = document { print("Document data: \(document.data())") } else { print("Document does not exist") } }, onError: { error in print("Error fetching snapshots: \(error)") }).disposed(by: DisposeBag())