Cannot find how to pass firestore settings using a new modular API
See original GitHub issueVersion info
Angular: 12.1.1
Firebase: 9.1.3
AngularFire: 7.1.0
With old API, we could pass settings (for example ignoreUndefinedProperties: true
) into firestore using provider FIRESTORE_SETTINGS
as folowing:
import {SETTINGS as FIRESTORE_SETTINGS} from '@angular/fire/compat/firestore';
@NgModule({
imports: [
AngularFireModule.initializeApp(environment.firebaseConfig, 'My-App'),
],
providers: [
// ...
{
provide: FIRESTORE_SETTINGS,
useValue: { ignoreUndefinedProperties: true }
},
]
})
After consulting documentation and source code of angularfire
I coundn’t find the way to do the same with new modular API:
@NgModule({
imports: [
// ...
provideFirebaseApp(() => initializeApp(environment.firebaseConfig)),
provideFirestore(() => {
const firestore = getFirestore();
if (!environment.production) {
connectFirestoreEmulator(firestore, 'localhost', 8080);
}
return firestore;
}),
]
})
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:8
Top Results From Across the Web
Get started with Cloud Firestore - Firebase
This quickstart shows you how to set up Cloud Firestore, add data, then view the data you just added in the Firebase console....
Read more >How to upgrade to Node.js SDK Admin SDK v10 (modular ...
from 'firebase-admin/messaging' const messaging = getMessaging(); const firestore = getFirestore(); import DocumentSnapshot = functions. ...
Read more >Adding data | Firestore - Google Cloud
There are several ways to write data to Firestore: Set the data of a document within a collection, explicitly specifying a document identifier....
Read more >Firebase / Firestore Integration - Retool Docs
The query the RealtimeDB, create a new query (+new in the bottom panel), and select your Firebase resource from the resource dropdown. Then,...
Read more >Firebase Modular JavaScript SDK Documentation
import firebase from 'firebase/app'; import 'firebase/auth'; firebase.initializeApp({ /* config */ }); const auth = ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@skog-newglue looks like you are mixing new and old API. Start by removing everything imported from
@angular/fire/compat/*
:And in your client code use:
@anisabboud this code works. Thanks!