angularfire2

How do I make a query based on the return of another query in Angular with Firestore?

梦想与她 提交于 2020-12-15 05:47:21
问题 Im trying to get some Ids from a collection, and then trying to use each of these Ids to get more data from another collection. Here is what I got done so far: Basically, I have blog app in which multiple users will be able to post an article. And said article has categories. The thing is, when a user selects a category to filter, it will bring me all USERS that have an article in said category (instead of bringing all articles of the selected category). So, in Firestore I have: categories/

Check a document field for a specific value in Cloud Firestore

孤街醉人 提交于 2020-12-13 04:09:36
问题 I want to create a user registration with custom usernames. I store the user's username on a user document in Firestore. How can I validate a username already exists in my Users Collection? Maybe someone already have snippet for reactive form validation? 回答1: There is no efficient way to check all documents in a collection for a specific value. You would have to read each document in turn, and check them. That is prohibitive both from a performance and a cost standpoint. What you can instead

Unable to subscribe after forkjoin

孤人 提交于 2020-12-12 02:12:03
问题 I want to perform some firebase operation inside a loop in angular. When I send an HTTP request to firebase it returns an array of observables so using forkjoin i convert this array of observables into single observables. Now the problem is when I subscribe to these new observables I didn't get anything get_student_email() { this.get_project_service .get_project_by_doc_id(this.batchID, this.projectID) .subscribe((res) => { this.response = res; this.email = this.response.student; let data =

Unable to subscribe after forkjoin

淺唱寂寞╮ 提交于 2020-12-12 02:11:13
问题 I want to perform some firebase operation inside a loop in angular. When I send an HTTP request to firebase it returns an array of observables so using forkjoin i convert this array of observables into single observables. Now the problem is when I subscribe to these new observables I didn't get anything get_student_email() { this.get_project_service .get_project_by_doc_id(this.batchID, this.projectID) .subscribe((res) => { this.response = res; this.email = this.response.student; let data =