Closed artrayd closed 3 years ago
I need to use distributed counters firebase feature
Here are firebase docs: https://firebase.google.com/docs/reference/js/firebase.firestore.FieldValue
Here is my code: const increment = this.$fire.firestore.FieldValue.increment(1) snapshot.docs[0].ref.update({ count: increment })
Here is the error I'm getting: TypeError: Cannot read property 'increment' of undefined
Is there any change to get it working?
Yes, see https://firebase.nuxtjs.org/guide/usage/#firemodule .
Just use this.$fireModule.firestore.FieldValue.increment(1)
this.$fireModule.firestore.FieldValue.increment(1)
I need to use distributed counters firebase feature
Here are firebase docs: https://firebase.google.com/docs/reference/js/firebase.firestore.FieldValue
Here is my code: const increment = this.$fire.firestore.FieldValue.increment(1) snapshot.docs[0].ref.update({ count: increment })
Here is the error I'm getting: TypeError: Cannot read property 'increment' of undefined
Is there any change to get it working?