Firebase - click an object in a nested list of objects

Firebase - click an object in the nested list of objects

Current attempt:

this.application.userUid = this.uid; this.application.companyUid = job.uid; this.application.jobName = job.name; this.application.jobDescription = job.description; this.application.jobId = job.id; this.refApp.child(this.uid).child(job.id).push(this.application); 

Currently, an object is being added, but nested too low. It should be like the second object in the list.

uid → jobid → then the object.

Here is my database:

enter image description here

+2
source share
1 answer

Use .set() instead of .push()

 this.refApp.child(this.uid).child(job.id).set(this.application); 

However, if you want to generate an identifier using .push() , you can return one level in the data structure:

 this.refApp.child(this.uid).push(this.application); 
+2
source

Source: https://habr.com/ru/post/1238737/


All Articles