Questions tagged google-cloud-firestore

Explore the latest questions and answers asked by our top developers.

Angular FireBase / Show products by categories on page

I want to product what i make shows on page dogs not on all pages or not on just one, i want to specify on page that is for dogs, cats, bird and that. I have make add-item, item.component.html Source: Angular Questions

Add additional property to an observable

Can someone help me out with Observables, I am trying to return 2 things in an observable i.e. call a service to upload a file and get back the percentage complete as an observable. Once that is completed I also want access to another property i.e. the download URL that came from the same service […]

By ccocker
Published
Categorized as angular, google-cloud-firestore, rxjs Tagged , ,

For Angular Material MatTable, AngularFire collection query "this.filteredData" is undefined when multiple queries are chained

… this.db .collection(uid, (ref) => { console.log(‘ref’, ref); return ref.where(‘year’, ‘==’, ‘1954’).orderBy(‘lastName’); }) .snapshotChanges() … This produces the error: ERROR TypeError: Cannot read properties of undefined (reading ‘length’) at MatTableDataSource._filterData (table.js:725) When I dig into the table module in node_modules at @angular/material/ivy_ngcc/fesm2015/table.js : /** * Returns a filtered data array where each filter object contains […]

Collection subscription returns null on server timestamp

I’m adding documents to a subcollection called workReports while I’m subscribed to it. Method for query: getWorkReportsByProjectId(projectId: string): Observable<ProjectWorkReport[]> { return this.db .collection("projects") .doc(projectId) .collection<ProjectWorkReport>( "workReports", ref => ref.where("invalid", "==", false).orderBy("createdAt", "desc") ) .valueChanges({ idField: "id" }); } Method for creating (notice createdAt): createProjectWorkReport(projectId: string, workReport: ProjectWorkReport): Promise<DocumentReference> { return this.db .collection("projects") .doc(projectId) .collection<ProjectWorkReport>("workReports") .add({ […]

How can I get the parent attribute from a collectiongroup in a firestore database using Angular?

I use the following code to get all the music from my firestore database. All of these are nested within the artist: this.db.collectionGroup(‘music’) .valueChanges({ idField: ‘key’, }) .subscribe((music: any) => { this.filteredMusic = this.music = music.map((music: any) => { return { name: music[‘name’], genre: music[‘genre’], artist: music[‘artist’], key: music[‘key’], }; }); this.dataSource = new MatTableDataSource<Artist>(this.filteredMusic); […]

Angular / Firestore – Await document update, add, or set

Is it possible to await a successful document write to Firestore? I have a component that calls an add function in a service: save(){ this.aService.new(); } In the service I have a standard angular fire add function: new(){ this.afs.collection<any>(`col/doc/col`).add({ title: "A new Title", }); } I would like to react to a successful add, update […]

Getting wrong results: Time-zone issue when hitting api from AngularJS and quering for result from firebase using NodeJS

i have wrong result returned when queried with date-range. i am using DateRangePicker jQuery for selecting date range and time range. then i hit my api and send my date/Moment js object to my node js api on which i query firestore for docs added on a specific date range! this is my code: api.get(‘/getDoc’, […]

Getting wrong results: Time-zone issue when hitting api from AngularJS and querying for result from firebase using NodeJS

I have wrong result returned when queried with date-range. I am using DateRangePicker jQuery for selecting date range and time range. Then I hit my api and send my date/Moment js object to my node js api on which I query firestore for docs added on a specific date range! This is my code: api.get(‘/getDoc’, […]

Getting wrong results: Time Stamp offset issue with time-zone when quering for result from firebase

List item i am selecting a date range using jquery date-range picker: i am running a query on the data. this query is using ‘firebaseAddDate’ reference: ref= ref.where(‘firebaseAddDate’, ‘>’, start).where(‘firebaseAddDate’, ‘<‘, end).orderBy(‘firebaseAddDate’, ‘desc’); My data is stored in firebase in this format: I have selected 29-nov-2021(00:00 – 23:59) as date and time range. The problem […]

Angular with Firebase – missing or insufficient permissions after app check

I use angularfire to interact with firestore in my angular app. Unfortunately, after I setup app check in the firebase console, I’m getting ERROR FirebaseError: Missing or insufficient permissions. in the console of my webbrowser after the first interaction with firestore (see component below), Here are some useful informations for you, which I copied from […]

1 2 3 50

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq