Closed edukun closed 4 years ago
I don't think that API is available in the firebase service which represents firebase.app.App
. Try this:
import firebase from 'firebase';
firebase.FieldValue.arrayUnion(...);
Now it shows me this error: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp() If I call firebase.initializeApp(), then says that API key is invalid
Could firestore be imported directly? this is the class I need to access https://firebase.google.com/docs/reference/js/firebase.firestore.FieldValue
Sorry about that it should be firebase.firestore.FieldValue.arrayUnion(...)
.
And yeah, you can import firebase
directly for use-cases where you need the API for firebase
.
Ok, solved. Just needed to call firebase.firestore.FieldValue.arrayUnion(...)
instead of this.get('firebase')
I'm trying to use the arrayUnion function of firestore, but it says that FieldValue is undefined.
firebase: service() ... this.get('firebase').firestore.FieldValue.arrayUnion(...)
I have ember-firebase-service 6.0.4 and firebase 7.7.0