Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initializer for conditional binding must have Optional type, not 'DocumentSnapshot' #32

Open
MarsXan opened this issue Mar 28, 2020 · 0 comments

Comments

@MarsXan
Copy link

MarsXan commented Mar 28, 2020

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())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant