nuxt-community / firebase-module

🔥 Easily integrate Firebase into your Nuxt project. 🔥
https://firebase.nuxtjs.org
MIT License
642 stars 98 forks source link

How to use Firebase Timestamp feature? #335

Closed sergiocerrutti closed 4 years ago

sergiocerrutti commented 4 years ago

Version

@nuxtjs/firebase: 6.1.0 firebase: 7.17.1 nuxt: 2.13.0

Steps to reproduce

Try to use Timestamp feature this way: this.$fireStore.Timestamp.

What is Expected?

Timestamp should has a few methods inside like now() or fromDate().

What is actually happening?

Timestamp is not defined inside this.$fireStore, or I don't know how to access it.

lupas commented 4 years ago

Hi @sergiocerrutti

There is a difference between the module firestore (which has .timestamp) and the initialized instance of firestore() (which does not).

You can access the module like so:

this.$fireStoreObj.Timestamp

See https://firebase.nuxtjs.org/guide/usage#general-usage

Hope that helps.