document.onSnapshot is not a function when trying to sync a single value instead of a collection #1303
-
Reproductionthis.$bind( "isAdmin", db.collection('users').doc(userId).get("isAdmin")) Steps to reproduce the bugthis.$bind( "isAdmin", db.collection('users').doc(userId).get("isAdmin")) Expected behaviorI expect the single boolean value in firebase to sync in realtime with the boolean value in Vue. Actual behaviorI get an error: Uncaught (in promise) TypeError: document.onSnapshot is not a function Additional informationI did not see anything in the documentation for VueFire 2 about realtime individuals values instead of collections. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
the BTW, you should definitely use Firebase v9 + VueFire v3. The v2 is very old and is not receiving any updates anymore. |
Beta Was this translation helpful? Give feedback.
the
get()
function already returns a promise. VueFire can only bind documents or collections, it cannot bind a single value as there wouldn't been automatic updates, which is where theonSnapshot()
is not a function comes from 🙂BTW, you should definitely use Firebase v9 + VueFire v3. The v2 is very old and is not receiving any updates anymore.