Closed jayolin closed 6 years ago
Thank you!
This is happening because there are some changes in firebase API, make sure to update your project to the latest release. Firebase release notes.
I upgraded my project's firebase to the latest, even tried installing vue-firestore again but the problem still persists
@jayolin yeah I see.
the issue is that you're adding a new record through a given query,
I suggest that you add another ref to your app,
this.$binding("feeds", firestore.collection('posts')
.where('followers.8v0RIxTPxX7wCttiREdF', '==', true)
.orderBy('created_at', 'desc')
.endAt(Date.now()-(60*5*60*1000))).then((feeds) => {
console.log(feeds)
})
// bind feedSource as original
this.$binding("feedSource", firestore.collection('posts').then((feeds) => {
console.log(feeds)
})
Then you can add a new record to your feeds via feedSource
.
this.$firestore.feedSource.add({
userId: "8v0RIxTPxX7wCttiREdF",
caption: "Stuff yeah",
created_at: Date.now(),
followers:{
"8v0RIxTPxX7wCttiREdF":true
}
})
I don't know if that does make sense to you, but please let me know!
Thanks for opening this issue, I really appreciate that.
@amranidev , awesome!! It works now. Thanks a bunch!
So I'm manually binding to a "feeds" array like this:
mounted(){
The problem is that when I try to add a new item to the database, i get the above error. This is the method to add a new feed:
addPerson(){
} It always yields a "vue.esm.js?65d7:1743 TypeError: this.$firestore.feeds.add is not a function at VueComponent.addPerson (firebase-component.vue?e36e:201) at click (firebase-component.vue?6199:67) at VueComponent.invoker (vue.esm.js?65d7:2029) at VueComponent.Vue.$emit (vue.esm.js?65d7:2540) at VueComponent.click (vuetify.js?e0ae:7237) at invoker (vue.esm.js?65d7:2029) at HTMLButtonElement.fn._withTask.fn._withTask (vue.esm.js?65d7:1828)"