You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The confusion comes from the fact that doc() doesn't return a document but a reference. With versions prior to 9, this wasn't much of an issue, but the functional style makes it look a bit funky.
I suggest renaming it to ref(), which would also make it consistent with the Firebase storage API. So:
getDoc(ref("some/path"))
Of course, collection also returns a ref, but that name doesn't create confusion for me. Maybe partially because you would not expect a synchronous call to collection() to return the actual documents. So this looks fine I think:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This to me reads like a mistake:
The confusion comes from the fact that
doc()
doesn't return a document but a reference. With versions prior to 9, this wasn't much of an issue, but the functional style makes it look a bit funky.I suggest renaming it to
ref()
, which would also make it consistent with the Firebase storage API. So:Of course,
collection
also returns a ref, but that name doesn't create confusion for me. Maybe partially because you would not expect a synchronous call tocollection()
to return the actual documents. So this looks fine I think:Beta Was this translation helpful? Give feedback.
All reactions